🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Curly braces { }
  2. B.Indentation (spaces at the start of the line)
  3. C.Semicolons
  4. 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 →