- This event has passed.
6 PM – Intro To Python – Darin
September 7, 2023 @ 6:00 pm - 7:00 pm
What We Did Today:
- Reviewed homework on functions with no return value
- Introduced the topic of functions with return values
Homework:
There are two parts to the homework, the website and the try it yourself from the book.
- Create a file called Sept7_FunctionsWithRV_HW.py and upload to google drive when finished.
- https://www.ayclogic.com/list-inputs-if-and-else-loops-and-function/ – number 7
- For those with the second edition of the book: Try It Yourself – page 137 do 8-3
- For those with the third edition of the book: Try It Yourself – page 136 – 137 do 8-3
Notes:
For the homework number 2:
The instruction says: Inside the function, convert the parameter “miles” into the “km” value. There are 1.6 km in one mile. Return the conversion result or the km value.
What this means is that you have to multiply the parameter named miles by 1.6 and return the output, and then print it in nice format.
For the homework number 3/4:
- Ignore the words “keyword” and “positional” in the homework for try it yourself. Just keep in mind that you are giving the function 2 parameters, size, and text, and then you are printing out “The shirt says {text} and is {size} cm big”.
- Here you are giving two different data types to the function, a string and an integer.