← Quiz: Python Introduction: all 15 questions
Quiz: Python Introduction · Question 4 of 15
How does Python show which lines belong inside an if block?
How does Python show which lines belong inside an if block?
- A.Curly braces { }
- B.Indentation (spaces at the start of the line)
- C.Semicolons
- D.The keyword "end"
Answer & explanation
Correct answer: Indentation (spaces at the start of the line)
Python uses indentation, usually 4 spaces, to group lines into a block.
Can you get the rest right without peeking?
Take the timed Quiz: Python Introduction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →