Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chosen_movies_qty = int(input())
- highest_rating = 0
- lowest_rating = 0
- total_movies_rating = 0
- highest_rating_movie = ''
- lowest_rating_movie = ''
- for movie in range(chosen_movies_qty):
- current_movie = input()
- rating = float(input())
- total_movies_rating += rating
- if rating > highest_rating:
- highest_rating = rating
- lowest_rating = rating
- highest_rating_movie = current_movie
- elif rating < lowest_rating:
- lowest_rating = rating
- lowest_rating_movie = current_movie
- average_movies_rating = total_movies_rating / chosen_movies_qty
- print(f"{highest_rating_movie} is with highest rating: {highest_rating:.1f}")
- print(f"{lowest_rating_movie} is with lowest rating: {lowest_rating:.1f}")
- print(f"Average rating: {average_movies_rating:.1f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement