Wednesday, 5 October 2016

dictionary for student's roll no. and name

#program to accept roll no & name of students as many as user want & store them into a dictionary

d={}
ch='y'
while ch!='n':
    rno=int(input('enter roll number:'))
    sname=input("enter student's name:")
    ch=input('do you want to continue...?(y/n)')
    d[rno]=sname
print('list of students')
print(d)

No comments:

Post a Comment