Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- word = input()
- key_char = [65, 69, 73, 79, 85, 89, 97, 101, 105, 111, 117, 121]
- score = 0
- winner_word = ""
- points = 0
- while word != "End of words":
- for i in word:
- score += ord(i)
- if ord(word[0]) in key_char:
- score *= len(word)
- else:
- score /= len(word)
- if score > points:
- points = score
- winner_word = word
- score = 0
- word = input()
- else:
- print(f"The most powerful word is {winner_word} - {math.floor(points)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement