Programming Examples
Python program to store the detail of 10 students in a dictionary at the same time
Can you store the detail of 10 students in a dictionary at the same time? details include – rollno, name ,marks ,grade etc. Give example to support your answer.
Solution
dic = { }
while True :
roll = input("enter the roll no. of student (enter Q for quit )= ")
if roll == "Q" or roll == "q" :
break
else :
name = input("enter the name of student = ")
mark = input("enter the marks of student = ")
grade = input("enter the grade of stucent = ")
dic[roll] = [ name , mark , grade ]
print(dic)
Output