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 01
Chapter 4 — Functions. In Foundations you already wrote def and return. Today is a brief review, then we go deeper.
A function is a named recipe. Parameters are the names in the parentheses at def. Arguments are the values you pass when calling.
def double(n):
return n * 2value = double(7)return sends a value back to the caller. print shows something on screen — that is not the same (we refine this later).
Common mistake: calling without parentheses; or forgetting return and expecting a magic result.
Learn: brief review of def, parameter, argument, and return.
MODULES IDLE
›