Advertisement
ALEXANDAR_GEORGIEV

easter_competition

Jun 3rd, 2022 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. count_cake = int(input())
  2. check_count_cake = count_cake
  3. current_name = ''
  4. current_scores = 0
  5. win_name = ''
  6. win_scores = 0
  7. while check_count_cake:
  8.     name_master = input()
  9.     total_grade = 0
  10.     while True:
  11.         grade = input()
  12.         if grade == 'Stop':
  13.             break
  14.         grade = int(grade)
  15.  
  16.         total_grade += grade
  17.  
  18.     print(f'{name_master} has {total_grade} points.')
  19.     if total_grade > win_scores:
  20.         win_scores = total_grade
  21.         win_name = name_master
  22.         print(f'{win_name} is the new number 1!')
  23.  
  24.     check_count_cake -= 1
  25.  
  26. print(f'{win_name} won competition with {win_scores} points!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement