+ 1
Expected an indential block error when trying to use if statement on python..why is this?
6 Antworten
+ 5
You probably didn’t space it correctly. Python is very specific about spacing. Could you share the code so we can help you fix it?
+ 3
Probably because you didn't use indentation. Did you use this:
if (True):
print("true")
instead of:
if (True):
print("true")
?
+ 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
+ 1
The problem is that you didn't indent the part after the if statement
+ 1
Correct it let me see pls
+ 1
x = int(input("First number: "))
if x > 4:
print("x is greater than 4")