Write a python script that prompts the user to enter the num

Write a python script that prompts the user to enter the number of students and each student\'s score, and displays the highest score along with the student\'s name. Do not use any looping structure other than while.

Solution

#taking number of calues

cases=int(input(\'Enter number of cases: \'))
for case in range(1,cases+1):print(\'case\',case)

grade=[]
names=[]
highest=0


#taking number of students

number=int(input(\'Enter number of students: \'))
for numbers in range (1,number+1):

#getting name and marks
name=str(input(\'Enter name of student: \'))
names.append(name)
mark=float(input(\'Enter mark of student:\'))
grade.append(mark)


print(\'Case\',case,\'result\')

#printing the results!
average=float(sum(grade)/number)
print(\'Average is: %.2f \'%(average))
print(\'Highest Score is: %.2f\'%(max(grade)))
print(\'Student with highest score: \',names[grade.index(max(grade))])

 Write a python script that prompts the user to enter the number of students and each student\'s score, and displays the highest score along with the student\'s

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site