Write a program to print even length words in a string


Topic: Write a program to print even length words in a string

Solution

  
def printWords(s): 
    s = s.split(' ')  
    for word in s:  
        if len(word)%2==0: 
            print(word)  
s = "hello world" 
printWords(s)



List all Python Programs