Lesson contents

Environment setup

Install the tools from the official guide. Save this program with the filename above the code, then run the command shown below. Seeing the number on screen means your first program ran.

Official installation guide

Simple example

Print a number.

Start1
Result1
lesson.mojo
def main() raises:
    print(1)
Output
1
Advertisements

Everyday examples

The school fair has a screen at the entrance. Test it by showing the number of the first ticket.

Start101
Result101
lesson.mojo
def main() raises:
    print(101)
Output
101
Run the example
Terminal
mojo lesson.mojo
Official documentation