typestar

Language basics

26 steps in 6 sets of Mojo.

Mojo reads like Python and compiles like a systems language, and this tour stays on the half that feels familiar. You type variables, typed function signatures, branches, loops, lists, dictionaries, strings, and error handling — the vocabulary every later tour builds on.

The resemblance to Python is real but not total. Every function is a def, a function that can fail has to say raises in its signature, string lists want an explicit type, and there is no negative indexing. Typing these lines out is the fastest way to feel where the two languages part company.

Start this tour

Variables & functions

Flow control

Collections

Strings

Errors

Encore

The other Mojo tours