🎙 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 3 of 15

What happens when you run print(Hello) without quotes (and no variable named Hello exists)?

What happens when you run print(Hello) without quotes (and no variable named Hello exists)?

  1. A.It prints Hello
  2. B.NameError
  3. C.It prints nothing
  4. D.SyntaxError on the next line
Answer & explanation

Correct answer: NameError

Without quotes, Python looks for a variable called Hello. It doesn't exist, so it raises a NameError.

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 →