Mid2 27th_Inputting_Student_Data

 entries=int(input("Enter the no. of entries: "))

d={}
for i in range(entries):
    student_name=input("Enter the student name: ")
    student_marks=int(input("Enter the percentage: "))
    d[student_name]=student_marks
print(d)
#output:
Enter the no. of entries: 2 Enter the student name: ubed Enter the percentage: 2 Enter the student name: rounak Enter the percentage: 4 {'ubed': 2, 'rounak': 4}

Comments

Popular posts from this blog

JAVA Lab Programs

HANGMAN GAME

WD 22. StylingLinks&Buttons