Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculate_ascii_sum(N):
- total_sum = 0
- for _ in range(N):
- letter = input().strip()
- total_sum += ord(letter)
- return total_sum
- # Input
- N = int(input())
- # Calculate the total sum
- total_sum = calculate_ascii_sum(N)
- # Print the result
- print(f"The sum equals: {total_sum}")
Advertisement
Add Comment
Please, Sign In to add comment