Skip to the workbench
IMON.WORLD

0 XP

Python

Loading the course

The course is being loaded. If it does not appear, the JSON file could not be read.

Study this chapter

Instructions

  1. Write your code in the editor.
  2. Press Run to see the output.
  3. Press Check answer when you think it is right.

Help

If you get stuck, press Reset to bring the starting code back, then work through it one step at a time.

The Python here is a teaching subset. Everything runs in your browser — nothing you type is sent anywhere.

How to answer

Write your code in the editor.

Python subset

  • def, return, if / elif / else
  • for over lists, while, range()
  • Lists, dictionaries, tuples, strings and numbers
  • len, range, max, min, sum, round
  • List and string methods: append, split, join, sort, reverse
  • import math for math.exp, math.sqrt and math.log

Learning modules

  • import requests — a fake API at api.example.com with users, documents, search and a health check. It returns a status code and a body, and it never touches the network.
  • import sqlite3 — an in-memory database. CREATE, INSERT, SELECT, UPDATE, DELETE, WHERE, ORDER BY, LIMIT and SUM.

Output

    Expected output

    Python for models

    Exercise 1 / 40

    AI Lab quiz