muhammad_nasif

Answer_2

Apr 20th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def even_checker(x):
  2.     if x % 2 == 0:
  3.         return True
  4.     else:
  5.         return False
  6.  
  7.  
  8. sentence = input()
  9. sentence = sentence.split(" ")
  10. listResult = []
  11. sum = 0
  12.  
  13. for word in sentence:
  14.     for ascii_alphabet in word:
  15.         sum += ord(ascii_alphabet)
  16.     if even_checker(sum):
  17.         listResult.append(word)
  18.     sum = 0
  19.  
  20. print(listResult)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment