Code Lab BetaBUILD. RUN. DISCOVER.
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
PYTHON FUNCTIONS / CHAPTER 04 / Learn / LESSON 08
Eighth class. print displays. return passes a value.
def show(n):
print(n)def give(n):
return nshow(3) prints 3, but has no useful value for later work (only None). value = give(7) stores 7 in value — then you can compute with it.
Common mistake: only printing inside a function and then expecting value = show(3) to be 3.
Learn: print displays; return passes a value.
LAUNCH STANDBY
›