Advertisement
eNeRGy90

Untitled

Dec 2nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. computers = int(input())
  2. total_rating = 0
  3. total_sales = 0
  4. sale = 0
  5.  
  6. for i in range(computers):
  7.     num = int(input())
  8.  
  9.     rating = num % 10
  10.     possible_sales = (num - rating) / 10
  11.     total_rating += rating
  12.  
  13.     if rating == 3:
  14.         sale = possible_sales * 0.50
  15.     elif rating == 4:
  16.         sale = possible_sales * 0.70
  17.     elif rating == 5:
  18.         sale = possible_sales * 0.85
  19.     elif rating == 6:
  20.         sale = possible_sales * 1
  21.     else:
  22.         sale = 0
  23.  
  24.     total_sales += sale
  25.  
  26. print(f"{total_sales:.2f}")
  27. print(f"{(total_rating/computers):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement