Python Basics Cheat Sheet
A quick reference for basic Python syntax and data structures.
| Type | Example |
|---|---|
| Integer | x = 10 |
| Float | x = 10.5 |
| String | x = "Hello" |
| Boolean | x = True |
| Structure | Example |
|---|---|
| List | my_list = [1, 2, 3] |
| Tuple | my_tuple = (1, 2, 3) |
| Dictionary | my_dict = {"key": "value"} |
| Set | my_set = {1, 2, 3} |
| Statement | Example |
|---|---|
| If-Else | if x > 10: ... else: ... |
| For Loop | for item in my_list: ... |
| While Loop | while x < 10: ... |