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

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad