0
I can't understand this error
word = input() l=list(word) for i,li in enumerate (l): if(l[i] != "a" & "e" & "i" & "o" & "u"): print(li)
4 Answers
+ 1
& is bitwise 'and'
The keyword for logical 'and' is "and"
Also "e", "i", "o" and "u" are Truthy values
To check if 'li' isn't a vocal you could do
if li not in "aeiou":
print(li)
0
the problem is in the use of & operator with strings.
you can use instead :
if l[i] not in "aeiou":
print(l[i])
0
This code that may help you more:
word = list(input( ))
for e in word:
if e not in "aeiou":
print(i)
- 1
it should be like:
if ( (l[i] != 'a') & (l[i] != 'b') & ... )