2. Functions def¶
We learned some Python functions:
len,int,float,print, andinput.Now we will create our own functions.
I use
defto define the function andreturnto return a value.There are functions that do not return anything.
Activity: CodeLens 2.1 (cl_l20_2a_en)
This function returns
Trueif the parameterxis even,Falseotherwise.Note that, unlike what we have seen so far, these lines of code will not be executed immediately.
It is necessary to call the function to execute them.
You have attempted of activities on this page
