+ 3
What is wrong
5 Answers
+ 12
RocketLover ,
the list comprehension is missing the input string *word*. should be:
a=[i for i in word if i not in vowels]
^^^^^^^^
+ 5
# If I understood what you want to do, this can be solved as follows:
word = input()
vowels=["a","e","u","i","o"]
a=[i for i in range(len(word)) if word[i] not in vowels]
print(a)
+ 5
# Or this one:
word = input()
vowels=["a","e","u","i","o"]
a=[i for i in word if i not in vowels]
print(a)
+ 3
# for i in word # complete instruction.
word = input()
vowels=["a","e","u","i","o"]
a=[i for i in word if i not in vowels]
print(a)
+ 3
Thank you all