PrevNext

If you're just starting out, it's easier to begin by running code online and worry about running locally later. You can find more information about running code online here.

Resources
IOI

for reference, software you can use at IOI

Code Editors vs IDEs

First, you'll need to decide whether to use a code editor such as Sublime Text or an integrated development environment (IDE) such as Visual Studio. An IDE provides many features beyond just a code editor, though as you won't need most of them for competitive programming, a code editor alone may suit your needs. More Info

Which code editor or IDE should I use?

It depends on your personal preference. Try multiple and see which one you like best.

Using an IDE/Editor

Windows

Python comes with a program, known as IDLE (Integrated Development and Learning Environment), that allows one to write and run Python code. It supports many features, such as syntax highlighting and automatic indentation, that one would normally expect from an code editor.

Alternatively, you can install editing software like PyCharm or VSCode.

Linux

You can use built-in terminal editors, like vim and nano. You can also install editing software like VSCode. If you don't know how to exit, have a look at this link.

Using the Command Line

Installation

Windows and Mac

Download Python through the official website.

Linux

If you have apt (the package manager), you can install Python 3 with

sudo apt install python3.8

You can also build from source and install.

Make sure that you are using the correct version of Python. Python 2 is quite different from Python 3 (but parts of the version number beyond 2. or 3. do not matter much). We generally recommend newcomers to use Python 3, but if you are used to programming in Python 2, that is OK too.

The Python version can matter when using the command line to run Python; sometimes, python3 must be used instead of python in order to run Python 3. Try both commands, and pay attention to the version that Python prints to determine if this is the case on your system. For example:

python --version   # prints Python 2.7.13
python3 --version  # prints Python 3.8.1

Module Progress:

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!

PrevNext