Spocoman

Computer Firm

Jan 6th, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. num_models = int(input())
  2. sales = 0.0
  3. rating = 0
  4. for i in range(0, num_models):
  5.     model = int(input())
  6.     model_rating = int(model % 10)
  7.     model_sales = int(model / 10)
  8.     if model_rating == 2:
  9.         sales += 0
  10.     elif model_rating == 3:
  11.         sales += model_sales * 0.5
  12.     elif model_rating == 4:
  13.         sales += model_sales * 0.7
  14.     elif model_rating == 5:
  15.         sales += model_sales * 0.85
  16.     elif model_rating == 6:
  17.         sales += model_sales
  18.  
  19.     rating += model_rating
  20.  
  21. print(f'{sales:.2f}')
  22. print(f'{(rating / num_models):.2f}')
  23.  
  24.  
  25.  
  26.  
Add Comment
Please, Sign In to add comment