Python & Terminal Setup (Student Guide)

You need this done before Lecture 04. It takes about 20 minutes.

1. Install Python

Install Python 3.10 or newer from the installer your institution provides, or search the web for "python download" and use the official result for your operating system.

Verify in a terminal (Terminal on macOS/Linux, PowerShell or CMD on Windows):

python3 --version
# Windows may use:
python --version

You should see something like Python 3.12.4. Any 3.10+ is fine.

2. Pick an editor

Pick one and stay with it all semester:

OptionGood for
IDLE (installs with Python)simplest start; run with F5
VS Code (free; search "VS Code download")comfortable editing + terminal in one window
Any plain-text editor + terminalminimal, always works

In VS Code, install the official Python extension (search "Python" in the Extensions panel and take the one published by the Python Software Foundation / Microsoft-distributed build).

3. Run your first program

Create a file hello.py containing:

print("hello from cs-ds problem solving")

In a terminal opened in the same folder:

python hello.py      # or: python hello.py

Expected output:

hello from cs-ds problem solving

4. The interactive console

Typing python (no file name) opens the interactive console — a calculator on steroids where each line runs immediately:

>>> 2 + 3 * 4
14
>>> "cs" * 3
'cscscs'
>>> exit()

Use it to test tiny ideas before putting them in a file. This habit pays off in every case study of the course.

5. Minimal terminal vocabulary

CommandMeaning
cd foldermove into folder
cd ..move one folder up
dir / lslist files (Windows / macOS-Linux)
python3 file.pyrun a Python file
pythonopen the interactive console

6. Troubleshooting

If stuck, bring the exact error text to the next lecture — reading error messages is a course skill, and we will practise it in Lecture 07.