So I have a string task where I'm supposed to remove the vowels from the input string.
case = list(input().lower())
vowels = ["a","e","i","o","u","y"]
for i in case:
for k in vowels:
if i == k:
ind = case.index(i)
del case[ind]
print(case)
Say my input is the word
'Tour'
instead of deleting vowels 'o' 'u' and printing
['t','r']
it prints
['t','u','r']
instead.
However, if I run the for statement separately through jupyter notebook, it can give me ['t','r'] but it's not supposed to run twice.
Any advice please.