0
Expected an indented block Error
Hi I recently start to learn python 😃 but I have a problem. I was coding in python, suddenly gave me Indentation Error. I don't know how to solve it. I erase codes and write them again but didn't solve.
4 Respuestas
+ 1
Hi! Indentation is a important concept in Python, and gives your code a structure; make it more easy to read and understand.
You have to use it for example when you use compound statements:
if ####:
#######
##
#####
elif ####:
####
#####
else:
#####
#######
def ####():
######
########
#######
The indentation consists of the spaces between the begining of the line and where the code on the line actually starts. Usually four spaces are used as indentation spaces, and it is important to be consistent (allways use four spaces). It is possible to use tabs instead of spaces, but don’t mix tabs and spaces.
+ 2
Per Bratthammar It solved!!!
😃
Thank you so much.
+ 1
post the link to your code. So, it'll become easy to solve your problem.
+ 1
Setup your code editor with your preferred indentation level and use tab from the keyboard not the space key to indent in block of code.