Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- movie = input()
- sum_max = -1000000
- best = None
- movie_count = 0
- while not movie == "STOP":
- movie_count += 1
- if movie_count == 7:
- print("The limit is reached.")
- break;
- sum_ascii = 0
- for letter in movie:
- sum_ascii += ord(letter)
- if 97 <= ord(letter) <= 122:
- sum_ascii -= 2 * len(movie)
- elif 65 <= ord(letter) <= 90:
- sum_ascii -= len(movie)
- if sum_ascii > sum_max:
- sum_max = sum_ascii
- best = movie
- movie = input()
- print(f"The best movie for you is {best} with {sum_max:.0f} ASCII sum.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement