Welcome to the Systems of Equations Workshop! In this workshop, we’ll learn how Python can solve systems of equations — and yes, even calculate how many kombuchas and cappuccinos you ordered. (Because who doesn’t need to know the precise extent of their caffeine addiction?)
- Setting up the equations: We write our equations as a matrix to keep things tidy.
- Python in action: Python crunches the numbers and tells us exactly how many kombuchas and cappuccinos were ordered.
- The big reveal: We now know exactly how bad our caffeine addiction is.
Before we dive into coding, let's make sure you have everything you need.
Python is the language we’re using, and here’s how you get it installed on your system:
- Step 1: Go to python.org/downloads.
- Step 2: Download the latest Windows installer.
- Step 3: Run the installer and check the box that says "Add Python to PATH".
- Step 4: Follow the installation steps.
- Step 1: Visit python.org/downloads.
- Step 2: Download the latest macOS installer.
- Step 3: Open the downloaded package and follow the prompts.
- Step 4: Alternatively, you can install Python via Homebrew (see below).
- Step 1: Most Linux distributions come with Python pre-installed. Check by opening a terminal and typing:
python3 --version
- Step 2: If it’s not installed, use your package manager. For example, on Ubuntu/Debian:
sudo apt-get update sudo apt-get install python3
- Step 3: For Fedora:
sudo dnf install python3
Homebrew is a package manager for macOS that makes installing software (like Python) a breeze. If you’d prefer to use Homebrew to install Python or other tools, follow these steps:
- Step 1: Open the Terminal application.
- Step 2: Paste the following command and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Step 3: Follow the on-screen instructions to complete the installation.
- Step 4: Once Homebrew is installed, you can install Python by typing:
brew install python
An Integrated Development Environment (IDE) or text editor makes coding easier. Here are some options:
-
Visual Studio Code (VS Code):
- Free and beginner-friendly.
- Download from code.visualstudio.com.
- Great for Python with the official Python extension.
-
PyCharm:
- Available as a free Community Edition.
- Download from jetbrains.com/pycharm.
-
Thonny:
- Designed specifically for beginners.
- Download from thonny.org.
-
Vim:
- A powerful text editor if you’re feeling adventurous.
- Quick Vim Tutorial:
- Open a file: In your terminal, type:
vim your_script.py
- Insert mode: Press
ito start editing. - Save and exit: Press
Esc, type:wq, then hitEnter. - For help: Inside Vim, type
:helpfor more commands.
- Open a file: In your terminal, type:
- Note: Vim has a steep learning curve, but it’s useful once you get the hang of it!
Once you’ve written your code (whether in VS Code, PyCharm, Thonny, or Vim), you can run it from your terminal or command prompt.
- Open your terminal/command prompt.
- Navigate to your script’s directory:
cd path/to/your/script - Run the script:
or on some systems:
python your_script.py
python3 your_script.py
- Python Official Documentation: docs.python.org
- Vim Basics: OpenVim Tutorial
- Beginner Python Tutorials: Check out free tutorials on Real Python or Codecademy.
This guide is designed to get you started on your Python journey in a fun, friendly way. Don’t worry if you’re new to programming – everyone starts somewhere. Grab your favorite IDE (or even Vim if you’re feeling bold), install Python (and Homebrew if you’re on a Mac), and dive into the code. Let’s discover the magic of solving systems of equations together!
Happy coding, and may your kombucha and cappuccino calculations always be precise!
---
# SystemOfEquations