# Intro to Python ## Week 7 ### Stretch yourself! --- ## While you wait - Make sure you are ready for the exam - Relax, you will have a second chance to improve your grade #### Open these URLs: - [NLPiA.org/fall26](https://NLPiA.org/fall26) - [GitLab.com/mesa_python/fall26](https://GitLab.com/mesa_python/fall26) - [Runestone.Academy](https://Runestone.Academy) - [NLPiA.org/fall26](https://NLPiA.org/fall26) - GitBash terminal ('`~$ prompt`') - Interactive Python terminal (`>>> ` prompt) --- ## Review | Chapter | Topic | Python | | ---: | :--- | :--- | | 1. | Intro | `print`, `()`, `"..."`, `'....'`, `None` | | 2. | Data | `input`, `12`, `1.2`, `=`, `+`, `-`, `*`, `**`, `int`, `float`, `str`, `type` | | 3. | Debugging | `ValueError`, `NameError`, `SyntaxError`, `RuntimeError` | | 4. | Iteration | `for`, `in`, `range`, `turtle.Turtle`, `+=` | | 5. | Modules | `math`, `random`, `turtle`, `string`, `sum`, `.pi`, `.abs` | | 6. | Functions | `def`, `return`, `()`, `assert`, `+=` | | 7. | Conditionals | `if`, `else`, `elif`, `bool`, `==`, `>`, `<` | | 8. | Iteration | `for`, `while`, `break`, `min`, `max` | | 9. | Strings | `str.`\[**TAB**\], `.lower`, `.upper`, `.title`, `str.split`, `.capitalize`, `.capitalize`, `.find`, `.replace`, `in` | | 10. | Lists | `list`, `index`, `[0]`, `[1]`, `[-1]`, `range(0, 21, 2)`, `slice(1, 11, 2)`, `[1:8:2]`, `[::2]`, `container[0:11]` | --- ## What's left? | Chapter | Topic | Python | | ---: | :--- | :--- | | 11. | Files | `open`, `file`, `with`, `.read()`, `.write()`, `.close()`, `zip` | | 12. | Dictionaries | `dict`, `{}`, `.get`, `in`, `set`, `pandas`, `pip`, `uv` | | 13. | Exceptions | `try`, `except`, `finally`, `raise` | | 14. | HTML | `flask`, `requests` | | 15. | GUIs | `tkinter` | | 16. | Recursion | `def`, `lambda` | | 17. | Classes | `class`, `object`, `pandas`, `.read_csv()` | | 18. | OOP | `__init__`, `__getitem__` | | 19. | Inheritance | `super` | | 20. | Testing | `pytest`, `doctest`, `assert` | --- ## Let's play a game! - How much can you figure out on your own? - This will be extremely difficult - It will stretch your brain - And test your exploration skills - It's like a hard new video game - you will "die" often! --- ## Download & play
- [wk7/active_stretch.py](https://nlpia.org/fall26/wk7/active_stretch.py) - [wk7/active_stretch_pairs.yaml](https://nlpia.org/fall26/wk7/active_stretch_pairs.yaml)
#### Have fun! --- ## Your results - [wk7/active_stretch_results.jsonl](https://nlpia.org/fall26/wk7/active_stretch_results.jsonl)