Getting Started with Python
See what people build with Python and the projects you'll build in this course, then set up Python, VS Code and Git on your own Windows or Mac computer. You'll find your way around the terminal, run your first program, learn to read the error message when something goes wrong, and use Git to get exercise code and hand in your work.
Updated
What Python Can Do
- What You Can Build with Python (Novice): Python is the language people reach for to automate chores, turn data into charts, train machine learning models and run the back ends of apps, and this lesson shows where each one runs, what the Python interpreter does, and the projects you'll build in this course.
- How This Course Works (Novice): How Python in Depth works on ask-codey.com, from reading a lesson and trying its Do It to exercises checked by pytest, chapter checks, module assessments and the projects you build.
Setting Up for Python
- Setup on Windows: Python, VS Code and Git (Novice): Install Python with the Python Install Manager, VS Code with its Python extension, and Git on Windows with winget, check them with py --version and python --version in VS Code's terminal, tell Git your name and email, and make a python-course folder.
- Setup on a Mac: Python, VS Code and Git (Novice): Install Homebrew, then Python, VS Code with its Python extension, Git and Git Credential Manager on a Mac, check Python with python3 --version in VS Code's terminal, see why the command is python3 on a Mac, tell Git your name and email, and make a python-course folder.
- Finding Your Way in the Terminal (Novice): The terminal is where you run Python programs, and four commands that work the same in PowerShell and zsh, pwd, ls, cd and mkdir, tell you which folder you're in, show what's there, move you to another folder and make a new one.
Your First Program
- Your First Python Program (Novice): Write a Python program in a .py file that prints lines with print(), run it with python and the file's name, leave notes in it with comments, and read a traceback from its last line up to find what went wrong and on which line.
Share Your Work with Git
- Get the Exercise Code with Git (Novice): Copy an exercise's repository from GitHub into your course folder with git clone, open the folder it makes in VS Code, and see with git status and git remote -v that your copy remembers where it came from.
- Hand In Your Work with Git (Novice): Hand in an exercise by making a public repository of your own on GitHub, pointing your clone at it with git remote set-url, saving your work with git add and git commit, sending it with git push, and submitting the repository's address.
Exercise: The Bakery Menu Board
- Exercise: The Bakery Menu Board (Novice): Finish Maple Street Bakery's menu board, a Python program that prints each item with print(), fixing a line with a missing quote, switching a sold-out item off with a comment and giving print() a number, then let pytest check every line and hand it in with Git.