
Programming is the process of writing instructions that a computer can follow to perform specific tasks. These instructions are written in programming languages such as Python, JavaScript, or C++. Programming is the foundation of software, websites, mobile apps, and even hardware systems.
Why Learn Programming?
Solve real-world problems with code
Automate repetitive tasks
Build websites, apps, and games
Boost your career prospects in tech and other industries
Python is one of the most popular languages for beginners and professionals alike, thanks to its:
Simple and readable syntax
Huge community and support
Versatility (web, data science, automation, AI, etc.)
Download Python:
Visit the official Python website
Download the latest version for your operating system (Windows, Mac, or Linux).
Install Python:
Run the downloaded installer.
On Windows, ensure the checkbox “Add Python to PATH” is checked.
Follow the on-screen instructions to complete the installation.
Verify Installation:
Open the command prompt (Windows) or terminal (Mac/Linux).
Type:
bashpython --version
You should see something like Python 3.12.1this.
Visual Studio Code (VS Code) is a free, lightweight, and powerful code editor that works well for Python programming.
Steps:
Download from the VS Code website.
Install it by following the instructions for your platform.
Open VS Code.
Install the Python extension:
Click on Extensions (square icon, left sidebar)
Search for “Python” and install the official Microsoft extension.
Let’s dive into hands-on coding!
Open VS Code.
Click.File > New File
Save the file as .pyhello.py (the.py extension tells VS Code this is a Python file).
pythonprint("Hello, World!")
Open a terminal in VS Code (View > Terminal or press `Ctrl + ``).
Type:
bashpython hello.py
You should see:
textHello, World!
Explanation:
print() It is a Python function that outputs text to the screen. "Hello, World!" Is it the string you want to display?
Python’s syntax is designed to be clean and easy to read.
Case Sensitivity:
Printand print They are not the same. Python is case-sensitive.
Indentation:
Indentation is required for blocks of code, such as inside functions, loops, or conditionals (usually 4 spaces).
pythonif True: print("This is indented")
The code belowif True: must be indented.
Comments:
Use the # symbol for comments.
python# This is a comment print("Comments are ignored by Python")
Variables:
pythonage = 25 name = "Alice" print(name, "is", age, "years old")
Variables store values for later use.
No Semicolons Needed:
Each statement doesn’t require a semicolon at the end.
pythonname = input("Enter your name: ") print("Hello,", name)
input() pauses and waits for you to type something.
The result is always a string.
Programming lets you talk to computers and build amazing things.
Python is a great language to start with: install it, add VS Code, and you’re ready to code!
Your first Python program uses print().
Key syntax: indentation, case sensitivity, comments, variables, and no semicolons.
2
8
0