r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery <mmontgom...@levado.to> writes: > ... >>def f(x): >> return x + 1 > ... >>>>> print("hello") > > To me, what would make more sense would be: > > Teacher: > > |>>> def r(): > |... return 7 > |... > |>>> def p(): > |... print( 7 ) > |... > |>>> r() > |7 > |>>> p() > |7 > > Pupil: > > That was a very instructive example, teacher. Thank you! > But could you also show us some context where the calls > to p and r show some difference? > > Teacher: > > |>>> print( r() ) > |7 > |>>> print( p() ) > |7 > |None > > |>>> x = r() > |>>> x = p() > |7 > > Pupil: > > Now I'm confused. What's "None"? > > Teacher: > > ...
I did do this too. I think that was helpful. I told them --- a print doesn't let you easily ``capture'' a value calculated in a procedure. Thank you! -- https://mail.python.org/mailman/listinfo/python-list