Functions (subroutines)

  1. Why use functions?
  2. Defining simple function
  3. Passing positional parameters to a function
  4. Function parameters can be named
  5. Mixing positional and named parameters
  6. Default values, optional parameters, optional parameters
  7. Default value in first param
  8. Several defaults, using names
  9. Arbitrary number of arguments *
  10. Fixed parmeters before the others
  11. Arbitrary key-value pairs in parameters **
  12. Extra key-value pairs in parameters
  13. Every parameter option
  14. Duplicate declaration of functions (multiple signatures)
  15. Pylint duplicate declaration
  16. Return more than one value
  17. Recursive factorial
  18. Recursive Fibonacci
  19. Non-recursive Fibonacci
  20. Unbound recursion
  21. Variable assignment and change - Immutable
  22. Variable assignment and change - Mutable
  23. Parameter passing of functions
  24. Passing references
  25. Function documentation
  26. Sum ARGV
  27. Copy-paste code
  28. Copy-paste code fixed
  29. Copy-paste code further improvement
  30. Palindrome
  31. Exercise: statistics
  32. Exercise: recursive
  33. Exercise: Tower of Hanoi
  34. Exercise: Merge and Bubble sort
  35. Exercise: Refactor previous solutions to use functions
  36. Solution: statistics
  37. Solution: recursive
  38. Solution: Tower of Hanoi
  39. Solution: Merge and Bubble sort