Question: What is the correct version of this python code: file1 = open('student.txt', 'r') read = file1.readlines() names=[] marks=[] for i in read: p=i.split() names.append([1]) marks.append(int(p[2]))

What is the correct version of this python code:

file1 = open('student.txt', 'r') read = file1.readlines() names=[] marks=[] for i in read: p=i.split() names.append([1]) marks.append(int(p[2])) average = sum(marks)//len(names) maximum = max(marks) minimum = min(marks) print('There are a total of '+str(len(names))+' students') print('The average of total marks is '+str(average)) max_index = marks.indes(maximum) min_index = marks.index(minimum) print(names[max_index]+'scored the highest marks as '+str(maximum)) print(names[min_index]+'scored the lowest marks as '+str(minimum)) 

USING PYCHARM ONLY.

What is the correct version of this python code: file1 = open('student.txt',

. 6. Write a Python program that reads a text file called student.txt. The input text file contains student_ID, student_name, Quiz_grade as well as Test_grade for each student. Your program should read each student details from the file Then calculate the average of Quizzes and Tests marks Display the students' details: Total number of students, total average, the total highest and lowest marks. The program should output the report into a file called output.txt. A sample of output text file is given below. . . . student.txt: ID Test (60%) Quiz (40%) 65 97 79 50 90 Name Alia Shamma Zainab Noora Hamda 20181867 20197541 20183245 20199876 20185432 20179807 84 66 30 75 55 Fatma 78 82 output.txt: Class Report There are total of 6 students The average of total marks is 71.267 Shamma (20197541) scored the highest marks as 45 Hamda (20185432) scored the lowest marks as 92.8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!