Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- two_strings = input().split()
- longest = max(two_strings, key=len)
- two_strings.remove(longest)
- shortest = two_strings[0]
- sum_of_chars = 0
- for i in range(len(longest)):
- if i < len(shortest):
- sum_of_chars += ord(longest[i]) * ord(shortest[i])
- else:
- sum_of_chars += ord(longest[i])
- print(sum_of_chars)
Advertisement
Add Comment
Please, Sign In to add comment