8th Feb 2023, 6:43 PM
RocketLover
5 odpowiedzi
+ 12
RocketLover , the list comprehension is missing the input string *word*. should be: a=[i for i in word if i not in vowels] ^^^^^^^^
8th Feb 2023, 6:55 PM
Lothar
Lothar - avatar
+ 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)
8th Feb 2023, 6:52 PM
JaScript
JaScript - avatar
+ 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)
8th Feb 2023, 6:54 PM
JaScript
JaScript - avatar
+ 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)
8th Feb 2023, 6:52 PM
Jayakrishna 🇮🇳
+ 3
Thank you all
10th Feb 2023, 7:48 AM
RocketLover