🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Conditions: all 13 questions

Quiz: Python Conditions · Question 4 of 13

What is wrong with this code? (code)

What is wrong with this code?

if marks >= 40
    print("Pass")
  1. A.Nothing
  2. B.The colon after the condition is missing
  3. C.print needs brackets
  4. D.
    = is not valid in Python
Answer & explanation

Correct answer: The colon after the condition is missing

Every if line must end with a colon.

Can you get the rest right without peeking?

Take the timed Quiz: Python Conditions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →