Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- movie_volume = int(input())
- max_rating = 0
- min_rating = 10
- movie_max_rating = ""
- movie_min_rating = ""
- average_rating = 0
- for i in range(movie_volume):
- movie = input()
- rating = float(input())
- average_rating += rating
- if rating > max_rating:
- movie_max_rating = movie
- max_rating = rating
- elif rating < min_rating:
- movie_min_rating = movie
- min_rating = rating
- print(f"{movie_max_rating} is with highest rating: {max_rating:.1f}")
- print(f"{movie_min_rating} is with lowest rating: {min_rating:.1f}")
- print(f"Average rating: {average_rating / movie_volume:.1f}")
Add Comment
Please, Sign In to add comment