PyAI Learn Türkçe

Module 3

Your own functions

def, return, parameters, chaining

When you finish this module you can say:

I can split a task into functions and connect their results.

By the end of this module you'll be able to write a calculator where every operation is its own function, that catches division by zero, and that takes input from the user.

Start

Lessons

7 lessons · ≈ 67 min

  1. def and return: your first function9 min
  2. Parameters9 min
  3. print vs return8 min
  4. Chaining functions10 min
  5. Docstrings and naming9 min
  6. Decomposition: splitting a big task10 min
  7. Project: Calculator12 min · project

Practice exercises

Short writing exercises, independent of the lessons: Go to the exercises

  1. Full name
  2. Division by zero: return None
  3. Shipping cost
  4. Documented circle area