name = "Malibongwe" # String
age = 30 # Integer
pi = 3.14 # Float
is_coding = True # Boolean
### Control Flow: Making Decisions
Programs aren't just lists of instructions; they need to make choices. This is handled by `if`, `elif`, and `else` statements.
```python
temperature = 25
if temperature > 30:
print("It's a hot day.")
elif temperature > 20:
print("It's a nice day.")
else:
print("It's cold outside.")
The Power of Indentation: Unlike other languages that use curly braces {}, Python uses whitespace. If your code isn't indented correctly, it won't run. This forces you to write clean, readable code by default.

Step 3: Mastering Data Structures
Data structures allow you to organize and store data efficiently. In Python, four built-in structures do 90% of the heavy lifting.
- Lists: Ordered, changeable collections.
my_list = [1, 2, 3, "apple"] - Dictionaries: Key-value pairs. Think of a real dictionary where the "word" is the key and the "definition" is the value.
user = {"name": "Alice", "id": 402} - Tuples: Similar to lists but unchangeable (immutable). Used for data that shouldn't be altered.
- Sets: Unordered collections of unique items. Great for removing duplicates from a list.
List Comprehensions (Pro Tip)
Pythonistas love "Pythonic" code, writing code that is concise and readable. A list comprehension is a great example:
# Create a list of squares for numbers 0-9
squares = [x**2 for x in range(10)]
This single line replaces what would take four lines in many other languages.

Step 4: Functions and Modular Code
As your projects grow, you’ll find yourself repeating code. To stay "DRY" (Don't Repeat Yourself), we use functions.
def greet_user(username):
return f"Hello, {username}! Welcome to the team."
message = greet_user("Malibongwe")
print(message)
Functions allow you to break complex problems into smaller, manageable chunks. Once you have a collection of functions, you can put them in a .py file and import them into other projects. This is the basis of Modules and Packages.
Step 5: Object-Oriented Programming (OOP)
OOP is often the biggest hurdle for beginners. Think of it this way: if a function is a "verb" (an action), a Class is a "noun" (a template for a thing).
If you’re building a racing game, you wouldn't want to manually define every car's speed and color. Instead, you create a Car class.
class Car:
def __init__(self, brand, color):
self.brand = brand
self.color = color
def drive(self):
print(f"The {self.color} {self.brand} is zooming!")
my_car = Car("Tesla", "Red")
my_car.drive()