muhammad_nasif

TASK_10

Apr 12th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. exam_marks = {'Sci fi': 12, 'Mystery': 15, 'Horror': 8, 'Mythology': 10, 'Young_adult': 4, 'adventure': 14}
  2.  
  3. max_key = 0
  4. max_val = 0
  5.  
  6. for key, value in exam_marks.items():
  7.     if max_val < value:
  8.         max_key = key
  9.         max_val = value
  10.  
  11. print("The highest selling book genre is '" + max_key + "' and the number of books sold are " + str(max_val))
  12.  
Advertisement
Add Comment
Please, Sign In to add comment