Back to blog
Python

Learn Python Basics in One Afternoon

Print your first message, store information in variables and make the computer repeat things for you.

Adam 20 September 2026 6 min read
Learn Python Basics in One Afternoon

Python is one of the friendliest languages in the world. It reads almost like English, which means you can spend less time fighting punctuation and more time building cool things.

Your very first line of code

Every coder starts with a greeting. The print() command tells the computer to say something out loud on the screen.

python
 1print("Hello, Kodland!")

Boxes called variables

A variable is like a labelled box. You put something inside it and use the label whenever you need it again.

python
 1name = "Adam"
 2age = 11
 3print("Hi " + name + ", you are " + str(age) + " years old!")

Make the computer repeat itself

Loops save you from typing the same thing over and over. This one counts to five and cheers at the end.

python
 1for number in range(1, 6):
 2    print("Step", number)
 3
 4print("Done! You just ran a loop.")
Friendly cartoon snake coding on a laptop

Try it yourself

Build a tiny quiz that asks a question and reacts to the answer.

  1. 1Ask for a name with input() and greet the person.
  2. 2Ask a maths question like 7 x 8 and store the answer.
  3. 3Use if and else to print 'Correct!' or 'Try again!'.
  4. 4Wrap it in a loop so the quiz asks three questions.
Back to blog

Keep going