What do you need? · Python Programming | StemPy Lab
Course 2.3·Lesson 1 of 4
What do you need?
You do not have to install Python to learn it here, because the code boxes run in your browser. Install it when you want to keep programs as files, work without the internet, or use the tools of professional programmers. Python needs a recent Windows, macOS or Linux system, a few hundred megabytes of space and an internet connection for the download. On a school computer, ask first. A Chromebook can use its Linux environment, and a phone is easiest with the code boxes.
about 30 min1 simulation2 practice questions
Lesson 1 of 4Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
After this lesson you can
decide whether you need to install Python now or later,
check that your computer is ready, and
name the three kinds of tool that you will use: Python itself, an editor, and a terminal.
Do I need to install Python?
No. Every program in this book runs in the code boxes in your browser. Many people learn their first steps this way, on a computer, a tablet or a phone. You can finish Chapters 1 to 5 without installing anything, and the rest of the book works in the code boxes too.
Install Python on your computer when you want to
keep your programs as files on your computer, so that you can open them tomorrow,
work without the internet,
use the same tools as professional programmers, and
run programs that need more time or files than a browser allows.
In the browser (this site)
On your own computer
Install
nothing
a free download
Internet
needed (to load Python)
only for the download
Your programs
in the code box
saved as files that end in .py
Works on a phone
yes
not easily
Tools for bigger projects
no
yes
Reading files and folders
no
yes
You will find that the two ways complement each other. The code boxes are fast and safe for learning. A computer with Python is for the work that you want to keep.
What does your computer need?
Python is small, and it runs on almost any computer. You need
Windows 10 or 11, a recent version of macOS, or Linux. (Very old systems, such as Windows 7, are not supported by the current Python.)
A few hundred megabytes of free space on the disk. Two gigabytes of memory is plenty.
An internet connection for the download. After that, Python works offline.
Permission to install programs. On a school computer, ask your teacher or the person who looks after the computers first. Do not install anything on a computer that is not yours without asking.
The three tools
When people say "I program in Python", they use three different things. It helps to know them by name.
Python itself. The program that reads your file and follows its lines. You install it once.
An editor. A program for writing and saving the file. It is like a notebook for code. IDLE, Thonny and Visual Studio Code are editors.
A terminal. A window where you type commands. You use it to run a file, and to install other tools. On Windows it is called Command Prompt, and on macOS and Linux it is called Terminal.
The lessons in this course teach you each one.
What about a Chromebook, a tablet or a phone?
Chromebook: you can turn on its Linux environment (in Settings, look for "Linux development environment"), and then follow the Linux steps.
Tablet or phone: there are Python apps for them, but they differ a lot from each other. The code boxes on this site work on a phone, and that is the easiest way to continue.
Which version of Python?
Python has a version number such as 3.12. The first number is the major version. You need Python 3. Python 2 is very old and has not been supported for many years. If a website or a book says print "hello" without brackets, it is for Python 2, and it will not work for you. For the second number, take the newest that python.org offers. The programs in this book work in all recent versions of Python 3.
The first number, 3, is the major version. It changes very rarely. The second number grows by one each year.
Check what this site uses
You can see the version of Python in the code box on this site.
Common mistakes
Thinking that you must install Python before you start. You do not.
Downloading from a website that is not python.org. It may add unwanted programs. Use only the official site.
Installing on a school computer without asking. The computer may be locked, or the rules may not allow it.
Choosing Python 2 because an old book uses it. Learn Python 3.
Practice
Start with two quick questions. Each New numbers gives you a fresh one, so you can practise as long as you like.
Then the labs and the problems:
Warm-up. Open the lab Read the version. It reads the version of Python and checks that you have Python 3.
Build. Open the problem Is the computer ready?, the problem Which computer can install Python? and the problem Choose a tool.
Stretch. Open the problem Which Python does this site use?, and compare it with the answer to the same question on your own computer, if you have installed Python.
Remember these
You do not need to install Python for this book. Install it to keep programs as files, to work offline, and to use professional tools.
You need three tools: Python, an editor and a terminal.
You need Python 3, and a recent system. Ask first on a school computer.
Download Python only from python.org.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Name two reasons to install Python on your own computer.
What are the three tools?
Which major version of Python must you use?
Does Python work offline after it is installed?
Enroll free in Install and Run Python at Home
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.