How to remove vowels in a string using one while loop and one or a couple of if statements ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to remove vowels in a string using one while loop and one or a couple of if statements ?

Please do not use functions

20th Apr 2017, 2:22 PM
Relo
Relo - avatar
2 Answers
+ 3
vows="A E I O U a e i o u".split() myString="This is my string" cleaned=[print(i,end='') for i in myString if i not in vows] I know, not a while loop or if statements, but it's a good way
20th Apr 2017, 4:20 PM
LordHill
LordHill - avatar
+ 2
vowel array {a,e,I,o,u} while (end of string reached) if char at index i of input string present in vowel array skip else include char in string
20th Apr 2017, 3:39 PM
Rahul S
Rahul S - avatar