The Computer Science app is a Python editor that runs in WebAssembly (Pyodide). When the status line says Python is ready, you have the standard library. There is no NumPy or pandas.
Goal
Know how Run, print, files, and Reset work before you count steps.
Run code
Paste into the editor and press Ctrl+Enter (Windows/Linux) or Cmd+Enter (macOS). The console is stdout. Use print.
cities = ["Nairobi", "Mombasa", "Kisumu"]
print(len(cities))
print(cities[1])Always print what you measured
steps = 0
for city in ["Nairobi", "Mombasa", "Kisumu"]:
steps += 1
if city == "Kisumu":
break
print("steps", steps)A loop that finds Kisumu in silence teaches nothing. Print the step count.
Files live in /uploads
Click Add files and choose cities.txt. After that:
from pathlib import Path
print(Path("cities.txt").read_text(encoding="utf-8").splitlines())Privacy
Python runs in this tab. Uploads live in IndexedDB on this device. Lesson pages never see your files.
Pitfall
list.index and sorted are fine in production. In this course, write the loop so you can count comparisons.