Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- movie_count = int(input())
- movies = []
- scores = []
- total_score = 0
- for i in range(1, movie_count + 1):
- name = input()
- score = float(input())
- total_score += score
- movies.append(name)
- scores.append(score)
- best_score = max(scores)
- best_movie = movies[scores.index(best_score)]
- min_score = min(scores)
- worst_movie = movies[scores.index(min_score)]
- print(f"{best_movie} is with highest rating: {best_score:.1f}\n{worst_movie} is with lowest rating: {min_score:.1f}\n"
- f"Average rating: {(total_score / movie_count):.1f} ")
Add Comment
Please, Sign In to add comment