GeorgiLukanov87

rating_salings

Mar 20th, 2022 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. count_models = int(input())
  2. rating = 0
  3. possible_sales = 0
  4. total_sales = 0
  5. all_rating = 0
  6.  
  7. for number in range(1, count_models+1):
  8.     current_num = int(input())
  9.     rating = current_num % 10
  10.     all_rating += rating
  11.     possible_sales = current_num // 10
  12.  
  13.     if rating == 2:
  14.         total_sales += 0
  15.     elif rating == 3:
  16.         total_sales += possible_sales * 0.50
  17.     elif rating == 4:
  18.         total_sales += possible_sales * 0.70
  19.     elif rating == 5:
  20.         total_sales += possible_sales * 0.85
  21.     elif rating == 6:
  22.         total_sales += possible_sales
  23.  
  24. print(f"{total_sales:.2f}")
  25. print(f"{all_rating / count_models:.2f}")
  26.  
Add Comment
Please, Sign In to add comment