A function is a named block of code that can be used in multiple places in your program. This section covers the basics on how to create and use functions.
1 - Read through Part 4.5 - Functions
2 - Complete Jokes.py and discounts.py as you work through the tutorial.
3 - Make sure you understand the difference between an argument and a parameter. See the FAQ below for another explanation.
4 - Complete functions_demo.py and submit it to the Hand-In folder.
1 - Submit the program functions_demo.py and submit it to the hand-in folder.
Q: What is the difference between a parameter and an argument?
Parameters are the names used when defining a function or a method, and into which arguments will be mapped. In other words, arguments are the things which are supplied to any function or method call, while the function or method code refers to the arguments by their parameter names.
Here is a website that gives a bit more: