# Python Basics Cheat Sheet
### by Sikho Programming — sikho_programming on Instagram

## Variables
```python
name = "Sikho"       # string
followers = 2750     # int
rating = 4.8          # float
is_live = True         # boolean
```

## Data Types
| Type | Example |
|---|---|
| int | `5` |
| float | `5.0` |
| str | `"hello"` |
| bool | `True` / `False` |
| list | `[1, 2, 3]` |
| dict | `{"key": "value"}` |

## Operators
```python
10 / 3    # 3.333 (true division)
10 // 3   # 3 (floor division)
10 % 3    # 1 (remainder)
2 ** 4    # 16 (exponent)
```

## Conditionals
```python
if score >= 90:
    print("A")
elif score >= 75:
    print("B")
else:
    print("C")
```

## Loops
```python
for lang in ["Python", "PHP", "C"]:
    print(lang)

while count < 3:
    count += 1
```

## Functions
```python
def greet(name, followers=0):
    return f"Hello {name}, {followers} followers!"
```

## Lists
```python
langs = ["Python", "PHP"]
langs.append("C")
langs[0]        # first item
len(langs)      # length
```

## Dictionaries
```python
profile = {"name": "Sikho", "followers": 2750}
profile["followers"]      # access
profile["active"] = True  # add new key
```

## String Formatting
```python
name = "Sikho"
print(f"Hello, {name}!")   # f-strings (preferred)
```

## Common Errors to Watch For
- Mixing tabs and spaces for indentation
- Forgetting `int()` when using `input()` for numbers
- Off-by-one errors with 0-based indexing

---
More tutorials at sikho_programming on Instagram, and on our website's Tutorials page.
