0

Shows expected indented block why what error

name=input("enter name") length=len(name) for i in range(0, length): if((name==a)or(name==e)or(name==o)or(name==i)or(name==u)): print("it has vowels") else: print("no vowles")

4th Sep 2017, 2:41 PM
corejava
6 odpowiedzi
+ 7
ya I know, just fixing his indents
4th Sep 2017, 3:29 PM
Ahri Fox
Ahri Fox - avatar
+ 6
#fixed it for you, but you're gonna need to define those letter variables: name=input("enter name") length=len(name) for i in range(0, length): if((name==a) or (name==e) or (name==o) or (name==i) or (name==u)): print("it has vowels") else: print("no vowles")
4th Sep 2017, 3:04 PM
Ahri Fox
Ahri Fox - avatar
+ 5
@corejava spaces like this yknow? it dictates the logic flow. if its too complex, maybe try brackets and then replace them with indents
4th Sep 2017, 5:45 PM
Ahri Fox
Ahri Fox - avatar
+ 3
the inside of every block has to be indented. if, for, while, try, except, def, elif, else, with, and I might forget some, but all of them are the head of the block (which is not indented more than what is outside of the block)
4th Sep 2017, 2:45 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
#fixed part with letters, but follow @Ahri for the rest if 'i' in name or 'e' in name or 'o' in name or 'u' in name or 'a' in name: PS : @Ahri, you can remove the 0 for range, it is implicit if not declared :)
4th Sep 2017, 3:06 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
@Ahri the same thing I have given right what is the difference between ur code and mine
4th Sep 2017, 3:50 PM
corejava