I know you didn't come here for teaching advice, but without an output, what's x + y
supposed to do? Why type it at all if you don't want the value to be output or stored anywhere?
Your students will be confused: "what does x + y
do?"
If you want to show some expression, just consistently put a print
statement in front of it, or assign it to a value.
I've found that people are often confused the other way around, so much that they don't know that return
actually gives them the value back, and they always want to use print
. Don't forget that you can define functions interactively, and put the return there. Then you can show them that the function returns that value, even with no print
s.