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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad