← Quiz: Python Functions: all 15 questions
Quiz: Python Functions · Question 9 of 15
What does this print? (code)
What does this print?
x = 10
def change():
x = 20
change()
print(x)
- A.10
- B.20
- C.None
- D.An error
Answer & explanation
Correct answer: 10
The x inside the function is local.
Can you get the rest right without peeking?
Take the timed Quiz: Python Functions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →