Public beta · October 2026Learn free with interactive tutorials, visualizations, quizzes and exercises. We're improving the site with learner feedback.Send feedback →

Learn Programming Visually with AI Tutor — Free Interactive Coding Lessons

Learn to code step by step with interactive visualizations, real code examples, quizzes and exercises in C, C++, Python, Java, JavaScript and C#.

Choose a programming language to compare code examples, or explore a beginner-friendly guide below.

Try a first lesson: count passing scores

A loop visits each value; a condition decides whether that value contributes to a result. Before running this Python example, predict how many scores meet the pass mark of 50.

scores = [42, 50, 73, 49]
passed = 0
for score in scores:
    if score >= 50:
        passed += 1
print(passed)
  1. 42: the condition is false, so passed stays 0.
  2. 50: equality is included by >=, so the count becomes 1.
  3. 73: the condition is true again; the count becomes 2.
  4. 49: the condition is false. The final output is 2.

passed += 1 counts a qualifying score; it does not add the score itself. Initializing the counter before the loop keeps the result from being reset on every iteration. The final print is outside the loop, so it reports one final count.

Check your understanding: what changes with > instead of >=?

The output becomes 1: 50 no longer qualifies, leaving only 73. This is why a test exactly at the boundary is useful. With an empty list, the original program prints 0 because the loop body never runs.

Next, try [50], [49] and []. Predict each result before running it. In the Python counting workshop, turn this example into a function and test your predictions.

Prefer C? Step through a C loop, then see how a pointer lets a function update a caller's variable.

Build your programming skills with a learning path

Choose C, C++, Python, Java, JavaScript, C#, or data structures. Follow a sequence of real lessons and save milestone progress privately on your device.

Explore learning paths →

Start with a visual programming guide

Read a beginner-friendly explanation, then open the interactive course to explore code and try the exercises.

Visual C programming topics

Explore individual interactive walkthroughs for loops, arrays, pointers and functions.