0Pricing
Mojo Academy · Lesson

Writing a def Function

Python-style, dynamic and forgiving.

Functions Bundle Logic

A function packages a piece of work under a name so you can run it whenever you like, instead of repeating code. 🧩

Meet the def Keyword

The def keyword defines a function the Python way: relaxed about types and easy to write while you explore an idea.

def greet():
    print("Hello from Mojo")

All lessons in this course

  1. Writing a def Function
  2. Writing an fn Function
  3. When to Reach for Each
  4. Return Types and None
← Back to Mojo Academy