Post

Jenny
Jenny@JennyTheDev·
@PythonPr Indentation. Python doesn't use {} like other languages. That single space decides if your code runs or throws IndentationError.
English
0
0
10
915
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr In Python, indentation defines the block. First example runs because print() is inside the if. Second fails (IndentationError) because the block isn’t indented. Whitespace = syntax in Python.
English
0
0
5
1K
GoncherGaming
GoncherGaming@GoncherGaming·
@PythonPr On the top one the print statement is indented properly and will only run if the if check returns true. The bottom one will print it no matter if the if check is true because the indentation makes it not under the if statement.
English
0
0
3
296
Ranjan
Ranjan@Ranjanrgdev·
@PythonPr Indentetaion in second is wrong in if statement we should add space after column
English
0
0
3
644
Makaveli
Makaveli@PrinceOfPain_·
@PythonPr In most programming languages, indentation is like seasoning, recommended, but optional. In Python, indentation is the recipe. Get it wrong and the whole dish crashes 🍽️🐍
English
0
0
2
42
Aninda-Tech Learner
Aninda-Tech Learner@devwithaninda·
@PythonPr One space can decide whether your code works or breaks 😄 Indentation matters in Python.
English
0
0
1
268
Evil_Hunter
Evil_Hunter@imsmartVik·
@PythonPr code is correct but python follows indentation hence will through error
English
0
0
1
30
P
P@Prosper3035·
@PythonPr Indentation
Dansk
0
0
1
8
Travis Abrahamson
Travis Abrahamson@abrahamsontl·
@PythonPr much like the 3 days I spent in MUMPS looking for a single missing period, it is in the indention.
English
0
0
1
76
Godson
Godson@Hokage12584241·
@PythonPr Python never jokes with indentation
English
0
0
0
1
Python Tech
Python Tech@PythonTech43716·
@PythonPr In python indentation error is very common,so in the 2nd code print is not correctly present.
English
0
0
0
11
แชร์