Advertisement
desislava_topuzakova

04. Train The Trainers

May 31st, 2020
1,426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. #1. четем презентации до получаване на Finish
  2. count_judges = int(input())
  3. # комнанда -> Finish или име на презентация
  4. command = input()
  5. sum_all_grades = 0
  6. count_grades = 0
  7. #stop: command == Finish; продължаваме: command != Finish
  8. while command != 'Finish':
  9.     #command => име на презентация
  10.     #получаваме си оценки
  11.     sum = 0 #сума за оценките от текущата презентация
  12.     for judge in range(1, count_judges + 1):
  13.         grade = float(input())
  14.         sum += grade
  15.         sum_all_grades += grade
  16.         count_grades += 1
  17.     #сума от оценките за текущата презентация
  18.     #средно аритметичното -> сумата / бр. хората в журито
  19.     average = sum / count_judges
  20.     print(f'{command} - {average:.2f}.')
  21.  
  22.     command = input()
  23. #command == Finish
  24. #средно аритметично за всички презантации
  25. # = сумата от оценките за всички презентации / брой оценки
  26. average_all_grades = sum_all_grades / count_grades
  27. print(f'Student\'s final assessment is {average_all_grades:.2f}.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement