Python program to print even length words in a string

 

str = input ('Enter String')

str +=' '

length = len(str)

x=''

for i in range (length):

    ch = str[i]

    if (ch!=' '):

        x=x+ch

    else :

        len1 = len(x)

        if (len1%2==0):

            print (x)

        x=''

Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.