How to start Coding

Starter Guide

Learning to code usually stalls before any code exists: choosing a language, installing tools, sitting through a course that shows nothing running for hours. None of that is needed today. A program is a list of instructions, and you can watch one run before you finish this page.

Your first day

1

Open a free online Python editor, such as the online compiler on programiz.com, which needs no account or install. Delete anything already in the box and type these two lines exactly, straight quotes included: name = "Sam" and, on the next line, print("Hello, " + name)

2

Before you press Run, say out loud what you expect to see, then run it. Starting takes about five minutes, and the guess is the point, because programming is mostly reading a line and knowing what it will do.

3

Now change Sam to your own name and predict again. Then add a third line, print(name * 3), guess what it does, and run it. Whether you were right or wrong, you have just used a variable, a name that stores a value so the program can reuse it. Nearly every program ever written depends on them.

4

If you see red text, that's an error message, and it names the line to look at. A missing quote or bracket is the usual cause. Fix that line and run again. Every programmer sees these daily.

The thing most people miss

It's easy to believe you must understand how computers work before you can write real code. You don't, and what builds skill is the guess before each run. Every time you predict what a line does and the result differs, you've found a gap in your mental model, and the output or error message shows you exactly where. Professionals spend far more time reading code than writing it, and predicting what it does is what reading is.

That's why running tiny changes beats reading about them. A wrong guess costs a few seconds and teaches something specific, whereas a chapter on strings teaches little until a string has surprised you.

A misconception worth correcting

Copying a working example and changing it is not cheating. It's how most people get their first programs running, and the changing is where the learning happens. Change one thing at a time so you know which change caused which result.

Next, learn the if statement, which runs one line when a condition is true and another when it isn't. Variables let a program remember and conditions let it choose, and together they are enough to build a surprising number of small tools.

Often explored alongside Coding

This reflects one contributor's own experience, not medical or safety advice. Read with your own judgment.