Python Fundamentals with Data Structures
Getting Started
Talking to Your Computer
Computers don't understand English. They speak in ones and zeros. A programming language like Python is a translator that lets us give instructions to a computer using words that are closer to our own language.
Think of it as hiring a very literal, very fast assistant. You have to give your instructions in a specific format Python understands, and it will translate them into actions for the computer to perform. Python is known as a high-level language because it handles a lot of the complex, behind-the-scenes computer operations for you, letting you focus on the task you want to accomplish.
Installing the Translator
Before you can write Python code, you need to install the Python interpreter. This is the core program that reads your instructions and translates them for the computer. The official place to get it is the Python Software Foundation's website, python.org.
When you download and run the installer, make sure to check the box that says "Add Python to PATH." This makes it much easier to run your code from anywhere on your computer.
The installer includes a simple program called (Integrated Development and Learning Environment). It's a basic tool for writing and running Python code, and it's perfect for getting started.
Your First Conversation
Open IDLE. You'll see a window with a >>> symbol. This is the Python Shell, and it's an interactive environment. It reads a single command, evaluates (runs) it, prints the result, and loops back for the next command. This is often called a REPL (Read-Eval-Print Loop).
Let's give it a command. The most basic one is print(), which tells Python to display something on the screen. The information you want to display goes inside the parentheses. Since we want to display text, we need to wrap it in quotation marks.
print("Hello, World!")
Type that line into the shell and press Enter. Python will immediately respond by printing the text back to you. The structure of this command, print("..."), is an example of Python's —the set of rules that define how to write valid code.
Writing a Script
The interactive shell is great for quick tests, but for more complex programs, you'll want to save your instructions in a file. This file is called a script.
In IDLE, go to File > New File. This opens a blank text editor. Type the same command in this new window:
print("Hello, World!")
Now, save the file (File > Save). Give it a name like hello.py. The .py extension is important; it tells your computer that this is a Python script.
To run your script, simply press the F5 key or select Run > Run Module from the menu. The output, "Hello, World!", will appear back in the interactive shell window. When you run a script, the Python interpreter reads the file from top to bottom, executing each line of code in order.
Why is Python referred to as a "high-level language"?
What is the primary role of the Python interpreter?
You've just taken the first step in programming: getting your computer to follow an instruction. From this simple command, all complex software is built, one line at a time.

