🐍 Writing Python 🐍
Posted on Aug 9th, 2022
🗓️ Today’s topics
- Python
- variables
if
statementswhile
loops- Practice with Turtle
- Input and output with
input
andprint
- Functions
✅ TODO today
Sign up for this practice site:Exercism.
Please sign up using your GitHub account (getting started instructions) and choose the Python track. Make sure that you are in Practice Mode.
If your exercises are locked you need to switch from Learning Mode to Practice Mode. Here’s a short video showing you how to do that.
You can use the in-browser editor, or work through their command line setup walkthrough to install Exercism on your computer.
⚠️ To run the tests locally, you will need a testing library called pytest
installed. To install the necessary dependencies, run the following at the command line (it does not matter what directory you are in when you pip
install something):
pip install pytest pytest-cache
Exercises we will work on in class:
- Hello World
- Two Fer
- Raindrops
And at least 1 of the following, your choice:
- Scrabble Score
- Hamming
- Resistor color
Be sure to read the instructions for each exercise carefully. Here is a guide to running the Python tests on Exercism.
If you get through all four of these, please continue with other exercises that seem interesting or fun to you. There are lots to choose from, and you want as much practice with Python as you can get.
🎯 Project
Please complete the Python section through “More iterating with Python” by Wednesday morning, 8/10.
🥡 How to submit your work
When you submit your solution for an exercism, you have the option to publish it. Please publish your solutions for the four exercisms required as specified above. You will then be able to see all your published solutions on your profile page.
You can find your profile page by clicking on your user avatar on Exercism and choosing “Public Profile” from the menu.
To submit your work, paste the URL for your Exercism profile page into this form.
🔖 Resources
Essential Python Resources
- ⭐ Official Python docs
- ⭐ Documentación de Python en Español
- 🐍 The Python Standard Library
- 🐍 La Biblioteca Estándar de Python
- 📚 Python for Everybody
- 📚 Python Para Todos en Español
- LearnPython Tutorial -> A good reference with examples and exercises.
- A Byte of Python -> Use this as a reference, starting at First Steps. DO NOT follow the installation instructions to download Python – you already have Python installed!
RealPython: Basic Python Tutorials
These articles are way more in-depth than you need right now, but they are good references for more information, if you feel you need that.
- Basic Data Types
- Variables
- Operators and Expressions
- Strings
- Python Program Lexical Structure
- Conditional Statements
- While Loops
- For Loops
- Basic Input and Output
- String Formatting
- Defining Your Own Python Function
- Docstrings in Python
📓 Jupyter Notebooks
- RealPython: Using Jupyter Notebooks (video)
- RealPython: Jupyter Notebook: an Introduction
- Setting Up Your Python Development Environment: Jupyter Notebooks section
- Using Jupyter Notebooks in VSCode -> This is an alternate way to run Jupyter Notebooks locally.
💁 Asking Questions + Getting Help
- Julia Evans, How To Ask Good Questions
- Rukia Sheikh-Mohamed, 5 Steps to Getting Unstuck
- Our Student Guidelines: Getting Help