← Quiz: Python Functions: all 15 questions
Quiz: Python Functions · Question 15 of 15
What is the difference between print() and return inside a function?
What is the difference between print() and return inside a function?
- A.There is no difference
- B.return shows the value on the screen; print sends it back
- C.print ends the function; return does not
- D.print shows a value on the screen; return sends a value back to the caller
Answer & explanation
Correct answer: print shows a value on the screen; return sends a value back to the caller
A function that only prints returns None, so you cannot use its result in a calculation.
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 →