Introduction to Python: Print and Repeat
From scratch, for someone who has never written code; the print command, variables, loops and functions — every line explained one by one, with colors.
Simple enough for a 5-year-old to understand
Your first words to the computer
Making the computer say something in Python is very easy. The "print" command writes everything you type inside quotes to the screen.
print("Hello!")Let's write two lines
Each "print" writes a separate line. Let's write two, one below the other.
print("I am writing code")print("So much fun!")🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (3 left)
🎯 Expected output: Hello World
Ready code templates
Copy-paste, run, adapt to your own needs. Every line explained.
Summing from 1 to N
A ready-made template that sums all numbers up to a given number. Change n, the rest stays the same.
n = 100total = 0for i in range(1, n + 1): total += iprint(total)Print a list with numbers
A template that shows everything in your list as "1) ... 2) ...".
items = ["Apple", "Pear", "Cherry"]for index, item in enumerate(items, 1): print(f"{index}) {item}")