Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num_models = int(input())
- sales = 0.0
- rating = 0
- for i in range(0, num_models):
- model = int(input())
- model_rating = int(model % 10)
- model_sales = int(model / 10)
- if model_rating == 2:
- sales += 0
- elif model_rating == 3:
- sales += model_sales * 0.5
- elif model_rating == 4:
- sales += model_sales * 0.7
- elif model_rating == 5:
- sales += model_sales * 0.85
- elif model_rating == 6:
- sales += model_sales
- rating += model_rating
- print(f'{sales:.2f}')
- print(f'{(rating / num_models):.2f}')
Add Comment
Please, Sign In to add comment