Use cases / Learn coding with live examples

Learn coding with live examples

Torki writes example code, runs it live in Canvas, and explains each line — creating an interactive coding classroom where you can edit and experiment.

Try in Torki
Category
Education
Feature
Canvas
Model
Cosmos
Share
Copy link
1

Choose what to learn

Tell Torki the topic — Python lists, JavaScript async/await, CSS flexbox, SQL joins. Specify your level so it starts at the right place.

Teach me Python lists — show me examples I can edit and run. I know basic variables and loops but haven't used lists much.

2

See live code examples

Canvas opens with the code on the left and output on the right. Each example is explained line-by-line. Edit the code and see results change instantly.

3

Progress through challenges

Ask for harder examples, edge cases, or mini-projects. "Now show me list comprehensions" or "Give me a challenge using everything we covered."

lesson.py
# Python Lists — Lesson 1 # Creating and using lists # 1. Create a list fruits = ["apple", "banana", "cherry"] print(fruits) # [apple, banana, cherry] # 2. Access by index print(fruits[0]) # apple print(fruits[-1]) # cherry (last item) # 3. Add items fruits.append("date") print(fruits) # [apple, banana, cherry, date] # 4. Slicing print(fruits[1:3]) # [banana, cherry] # 5. List comprehension lengths = [len(f) for f in fruits] print(lengths) # [5, 6, 6, 4] # Try editing this code! # Challenge: Add "elderberry" and sort the list
>>> ['apple', 'banana', 'cherry']
>>> apple
>>> cherry
>>> ['apple', 'banana', 'cherry', 'date']
>>> ['banana', 'cherry']
>>> [5, 6, 6, 4]

Ready to try for yourself?

Tell Torki what you want to learn. It creates live, editable code examples.

Try in Torki