Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def odd_even_sum(numbers: str):
- odd_sum = 0
- even_sum = 0
- for number in numbers:
- if int(number) % 2 == 0:
- even_sum += int(number)
- else:
- odd_sum += int(number)
- string_result = f"Odd sum = {odd_sum}, Even sum = {even_sum}"
- return string_result
- number_data = input()
- print(odd_even_sum(number_data))
Add Comment
Please, Sign In to add comment