+ 1

Why getting indentation error while using if statement on python(android)

4th Jul 2019, 3:50 PM
Ayo Ashaolu
Ayo Ashaolu - avatar
4 Respuestas
+ 3
show us the code, or we can't help you ... 😬
4th Jul 2019, 3:51 PM
Anton Böhler
Anton Böhler - avatar
+ 1
You need to insert some space after an if-clause. So not: if 2>1: print('yep') But: if 2>1: print('yep')
4th Jul 2019, 3:53 PM
HonFu
HonFu - avatar
+ 1
x=int(input('First number')) if x>4: print(' x greater than 4 ') This is an example..yets it gives expected an indented block error
4th Jul 2019, 4:21 PM
Ayo Ashaolu
Ayo Ashaolu - avatar
+ 1
x = int(input('First number')) if x > 4: print('c greater than 4')
4th Jul 2019, 4:55 PM
Anton Böhler
Anton Böhler - avatar