Generation

generate functionThu, 25 May 2023

leer las calificaciones correspondientes a una clase y contar el número total de aprobados y mostrar el nombre del alumno con el promedio más alto (Se debe pedir al usuario el número de estudiantes y sus nombre, la nota aprobadas son 11 a mas).

def grades(number_of_students): low = [] high = [] for i in range(number_of_students): name = input('name of student {}: '.format(i + 1)) grade = float(input('grade of student {}: '.format(i + 1))) if grade < 11: low.append(name) if grade >= 11: high.append(grade) high.append(name) print('list of students with low grades:') for name in low: print(name) print('student with highest grades:') print(high[1:]) print('the highest grade of the student:') print(float(max(high[1:]))) grades(10)

Questions about programming?Chat with your personal AI assistant