Write a program in python to create a dictionary of roll numbers and names of five students in a class. Search the roll number and display the name of the student.
Answers
Answered by
0
Answer:
students_and_roll = {1 : 'Student 1', 2 : 'Student 2', 3 : 'Student 3', 4 : 'Student 4', 5 : 'Student 5'}
print("Enter the roll number of the student: ")
roll_no = int(input("Roll number: "))
print(students_and_roll[roll_no])
Similar questions
Social Sciences,
3 hours ago
English,
3 hours ago
Geography,
5 hours ago
Math,
8 months ago
Math,
8 months ago