Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import sys
- #
- # film_name = input()
- # max_number_of_points = -sys.maxsize
- # number_of_movies = 0
- # too_much_films = False
- # value_of_the_digit = 0
- # name_of_film = ''
- #
- # while film_name != "STOP":
- # total_value_of_the_film = 0
- # number_of_movies += 1
- # if number_of_movies > 7:
- # too_much_films = True
- # break
- # else:
- # for name_digit in film_name:
- # value = ord(name_digit)
- # if name_digit != name_digit.lower():
- # value_of_the_digit = value - len(film_name)
- # elif name_digit == ' ':
- # value_of_the_digit = value - len(film_name)
- # elif name_digit == '' f'{name_digit.lower}': # малка буква, която след празен интервал трябва да я \
- # # направя голяма ??
- # name_digit = name_digit.capitalize()
- # value_of_the_digit = value - len(film_name)
- # elif name_digit == name_digit.lower():
- # value_of_the_digit = value - len(film_name) * 2
- #
- # total_value_of_the_film += value_of_the_digit
- # continue
- # if total_value_of_the_film > max_number_of_points:
- # max_number_of_points = total_value_of_the_film
- # name_of_film = film_name
- # film_name = input()
- #
- # if too_much_films:
- # print(f'The limit is reached.')
- # print(f'The best movie for you is {name_of_film} with {max_number_of_points} ASCII sum.')
- # else:
- # print(f'The best movie for you is {name_of_film} with {max_number_of_points} ASCII sum.')
- # МОЯТ ИЗБОР ЗА КОД !!!!
- best_movie_points = 0
- movie_name = ''
- movie_counter = 0
- while movie_counter < 7:
- name_of_movie = input()
- if name_of_movie == 'STOP':
- break
- current_score = 0
- for ch in name_of_movie:
- if ch == ch.lower():
- if ch.isalpha():
- current_score += ord(ch) - (len(name_of_movie) * 2)
- else:
- current_score += ord(ch)
- else:
- current_score += ord(ch) - len(name_of_movie)
- if current_score > best_movie_points:
- best_movie_points = current_score
- movie_name = name_of_movie
- movie_counter += 1
- if movie_counter == 7:
- print('The limit is reached.')
- print(f'The best movie for you is {movie_name} with {best_movie_points} ASCII sum.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement