0
Students=['student1','student2','student3','student4','student5','student6','student7','student8','student9','student10']

Marks = [45, 78, 12, 14, 48, 43, 47, 98, 35, 80]

def display_dash_board(students, marks):

    dictionary = dict(zip(Students,Marks))
    print(type(dictionary))

    print('top_5_students')
    
    for key, value in dictionary.items():
          print((key, value))

1 Answers1

1

Here is a simply way to get the top five elements:

dictionary={i:j for i,j in sorted(dictionary.items(),key=lambda x: x[1],reverse=True)[:5]}