← 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)?
- A.It prints Hello
- B.NameError
- C.It prints nothing
- 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 →