Python is a high-level programming language designed to be easier to read and write than low-level languages such as assembly. It lets people create data-analysis tools, games, websites, visualizations, file-organization apps, and automation. Computers convert Python into machine code before running it. section 1.1.1 section 1.2.1
Use Python to:
- Automate routine tasks and organize files. section 1.2.1
- Perform calculations and explore program behavior interactively. section 2.5 section 4.3
- Work with AI assistants that generate code, while reading and testing the results yourself. section 2.0 section 2.2.1
A first calculation
A small Python program can calculate a sum: a = 10, b = 20, and print(a + b) prints 30. Changing either value changes the result. A square-area example similarly assigns side = 5, calculates side * side, and prints 25. Missing punctuation, such as a comma or parenthesis, produces a syntax error, so generated code still needs to be run and checked. section 2.5
for num in range(0, 9):
print(num)
Shows a for loop using range; note that range stops before its second number, so range(0, 9) produces 0 through 8. section 1.1.1

























