Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python Prog: The program should solve the following problem: 1. prompt the user

ID: 3910084 • Letter: P

Question

Python Prog:

The program should solve the following problem:

1. prompt the user to enter the number of students and

2. for each student prompt the user to enter the name and score for that student

3. when done reading data for all students, display the two students with the highests scores. (notice that if the number of students is less than 2, the program still reads two students)

ex:

Explanation / Answer

num_students = 2 num = int(input('Enter a number of students (it has to be at least 2): ')) if num > 2: num_students = num students = [] for i in range(num_students): name = input('Enter a student name: ') score = float(input('Enter a student score: ')) students.append((name, score)) s1 = None s2 = None for student in students: if s2 is None: s2 = student elif s1 is None: s1 = s2 s2 = student else: if s1[1]