Sichanov

computer_firm

May 25th, 2021
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. number_of_computers = int(input())
  2. sales_counter = 0
  3. total_rating = 0
  4. for computer in range(number_of_computers):
  5.     number = int(input())
  6.     rating = number % 10
  7.     sales = number // 10
  8.     if rating == 2:
  9.         sales = 0
  10.     elif rating == 3:
  11.         sales /= 2
  12.     elif rating == 4:
  13.         sales -= sales * 0.3
  14.     elif rating == 5:
  15.         sales -= sales * 0.15
  16.     sales_counter += sales
  17.     total_rating += rating
  18. print(f'{sales_counter:.2f}')
  19. average = total_rating / number_of_computers
  20. print(f"{average:.2f}")
  21.  
Advertisement
Add Comment
Please, Sign In to add comment