Menu Close

Remove vowels in string Python….FTC

Write a program that accepts a string and redisplays the same string after removing vowels from it.

Input:
welcome

Output:
wlcm
string = input("Enter any String: ")
b=[]
c=0
for i in range(len(string)):
    if (string[i]=="a" or string[i]=="e" or string[i]=="i" or string[i]=="o" or string[i]=="u"):
        c=c+1
    else:
        b.append(string[i])
print ('\nWithout Vowels: ',*b,sep='')

INPUT_1:
Enter any String:  welcome
OUTPUT:
Without Vowels:  wlcm


INPUT_2:
Enter any String:  fcukthecode
OUTPUT:
Without Vowels:  fckthcd


INPUT_3:
Enter any String:  Pirate king
OUTPUT:
Without Vowels:  Prt kng


INPUT_4:
Enter any String:  Monkey D. Luffy
OUTPUT:
Without Vowels:  Mnky D. Lffy


ILLUSTRATION

Executed using python3 linux terminal