Computer Science, asked by pranshucool0, 5 hours ago

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 SpandanMukherjee428
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