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=''
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
Post a Comment