Some exercises and tutorials that I complete daily and weekly to familiarize myself with the language.
Notes: Writing functions def function_name(parameter1: expression, parameter2: expression,....parameter_n) -> return_type:
return value
- should be lowercase, use underscore to separate words, start with verb
- list input data in parentheses
- use comma for multiple and use colon to end
- code needs to be indented
- if function needs to return value use the return value
- Parameter is used when defined a function
- Argument is used to described the values that are passed through the function
- We can annotate the type of the parameter our function accepts
- We can specify tth return type by saying " -> " following the parentheses
- We can assign a default value to function int = default_value after the parameter