How to Start With Python the Basics for Absolute Beginners
Updated: March 27, 2026
TL;DR
Python is beginner-friendly, requiring only three steps to start: downloading Python 3.12+, writing your first script, and running it. This guide covers installation on Windows/Mac/Linux, essential syntax (variables, loops, functions), and building your first real programs without overwhelming complexity.
Python has become the #1 language for beginners in 2026, surpassing JavaScript and Java due to its readable syntax and career pathways in AI/ML. If you've never programmed before, Python won't intimidate you — it reads almost like English. Unlike languages that force you to wrestle with pointers, memory management, or type systems, Python lets you focus on logic first, syntax later. This guide walks you through everything needed to write your first working Python program, no experience required.
Installation: Getting Python on Your Computer
Python comes pre-installed on macOS and Linux, but you'll need to ensure it's Python 3.12+ (not Python 2, which is ancient). On Windows, you need to download it.
Windows
- Visit python.org
- Click "Download Python 3.12" (or the latest 3.x version)
- Run the installer
- Crucial: Check "Add Python to PATH" before clicking Install
- Verify by opening Command Prompt and typing:
python --version
You should see Python 3.12.x or higher.
macOS
Open Terminal and check your Python version:
python3 --version
If it shows 3.12 or higher, you're done. If it's older, install Homebrew first, then:
brew install python@3.12
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install python3.12 python3.12-venv
python3.12 --version
Your First Python Program
Once Python is installed, you're ready to code. Open a text editor (Notepad on Windows, TextEdit on Mac, or VS Code—free download) and create a file called hello.py:
# This is a comment — Python ignores lines starting with #
print("Hello, Python!")
name = "Alex"
print(f"Welcome, {name}!")
Save it. Open your terminal/command prompt, navigate to the folder where you saved hello.py, and run:
python hello.py
You'll see:
Hello, Python!
Welcome, Alex!
That's it. You just ran your first program. The print() function displays text. The = sign assigns values to variables (containers for data). The f before the string enables f-strings (Python 3.6+), which let you insert variable values directly into text.
Core Concepts Every Beginner Needs
Variables and Data Types
Think of a variable as a labeled box holding data:
age = 25 # Integer
height = 5.9 # Float (decimal)
name = "Jordan" # String (text)
is_student = True # Boolean (True/False)
print(f"{name} is {age} years old and {height}m tall")
Python figures out the data type automatically. You don't need to declare types like in Java or C++.
Basic Operations
# Math
total = 10 + 5
difference = 10 - 5
product = 10 * 5
quotient = 10 / 5 # Result is always a float
integer_division = 10 // 3 # Result: 3 (drops decimal)
remainder = 10 % 3 # Result: 1
# String operations
greeting = "Hello" + " " + "World" # Concatenation
repeated = "Ha" * 3 # "HaHaHa"
Conditional Logic (if/else)
age = 18
if age >= 18:
print("You can vote")
elif age >= 13:
print("You're a teenager")
else:
print("You're under 13")
The elif (else if) and else branches let your program make decisions.
Loops: Doing Things Repeatedly
The for loop repeats code a set number of times:
# Print numbers 1 to 5
for i in range(1, 6):
print(i)
# Loop through a list
fruits = ["apple", "banana", "orange"]
for fruit in fruits:
print(f"I like {fruit}")
The while loop repeats until a condition becomes false:
count = 0
while count < 3:
print(f"Count: {count}")
count = count + 1
Lists: Storing Multiple Values
scores = [95, 87, 92, 88]
print(scores[0]) # Access first element: 95
print(scores[-1]) # Last element: 88
scores.append(91) # Add to the end
scores.remove(87) # Remove value 87
for score in scores:
print(score)
Lists are ordered (position matters) and mutable (you can change them).
Functions: Reusable Code Blocks
Instead of rewriting code, wrap it in a function:
def greet(name, age):
"""This function greets someone"""
return f"{name} is {age} years old"
message = greet("Sam", 22)
print(message)
Functions take arguments (inputs), do something, and return a result. The """...""" is a docstring explaining what the function does.
Practical Project: Temperature Converter
Let's build something real — a tool that converts Celsius to Fahrenheit:
def celsius_to_fahrenheit(celsius):
"""Convert Celsius to Fahrenheit"""
return (celsius * 9/5) + 32
# Get user input
temp_c = float(input("Enter temperature in Celsius: "))
# Convert and display
temp_f = celsius_to_fahrenheit(temp_c)
print(f"{temp_c}°C is {temp_f:.1f}°F")
Run this and it asks for input, then shows the result. The input() function reads what the user types. The :.1f format rounds to 1 decimal place.
Essential Tools for Python Beginners
Local Development: VS Code + Python Extension
Visual Studio Code is free and beginner-friendly. Install the Python extension (search "Python" in VS Code's extensions tab), and you get syntax highlighting, auto-completion, and one-click run buttons.
Cloud Environments: Google Colab
If installation feels daunting, use Google Colab (colab.research.google.com). Sign in with Google, create a notebook, and start coding in your browser — no installation required. Perfect for learning.
Modern Package Manager: uv
Once you're ready for external libraries, uv is the modern replacement for pip. Install it, then manage dependencies faster:
uv pip install requests # Download a library
But for now, focus on Python's built-in features. You won't need external libraries yet.
Common Beginner Mistakes to Avoid
-
Confusing
=(assignment) with==(comparison)x = 5sets x to 5x == 5checks if x is 5
-
Forgetting colons (
:) afterif,for,defif age > 18: # Colon required print("Adult") -
Mixing up list indices — Lists start at 0, not 1
my_list[0]gets the first elementmy_list[1]gets the second
-
Indentation matters — Python uses spaces to define blocks
if True: print("This must be indented") # 4 spaces
What to Learn Next
Once comfortable with these basics:
- Dictionaries: Store data with labels (
{"name": "Alex", "age": 25}) - File I/O: Read and write files
- Libraries for AI/ML: NumPy, Pandas, TensorFlow (why most people learn Python in 2026)
- Web frameworks: Flask or FastAPI for building web apps
Free Resources to Accelerate Your Learning
- Python.org Tutorial: docs.python.org/3/tutorial/ — official, comprehensive
- Real Python: Real-world tutorials with tested examples
- freeCodeCamp: YouTube videos (search "Python for beginners")
- Google Colab: Interactive learning with zero setup
Conclusion
Python's simplicity makes it perfect for absolute beginners. You've now learned installation, variables, loops, conditionals, functions, and lists — enough to build real, working programs. The key to progress is writing code daily, even if just 15 minutes. Start with small projects (temperature converter, todo list, number guesser), and you'll develop intuition fast. Python's syntax will feel natural within weeks. The hardest part isn't the language — it's sitting down and starting. You just did that.