Computer Science, asked by atmhvm, 3 months ago

Write a Python script to make a dictionary of roll no,name and marks and also display the names of students who got 75 or more

Answers

Answered by Equestriadash
4

stud_dict = dict()

n = int(input("Enter the number of students: "))

print()

for i in range(n):

   x = int(input("Enter the roll number: "))

   y = input("Enter the name of the student: ")

   z = float(input("Enter the percentage: "))

   print()

   stud_dict[x] = [y, z]

print()

print("The students who have scored above 75: ")

for i in stud_dict:

   if stud_dict[i][1] >= 75:

       print(stud_dict[i][0])

Similar questions