Projects in this class use Python 3.
Project 0 will cover the following:
Instructions on how to set up Python and Work on assignments.
A mini-tutorial on Python.
A mini-tutorial on the autograder.
Files to Edit: You will fill in portions of addition.py, buyLotsOfFruit.py and shopSmart.py in tutorial.zip during this assignment.
Evaluation: Your code will be autograded for technical correctness. Please do not change the names of any provided functions or classes within the code; otherwise, the autograder will not be able to grade your work. Additionally, please do not add any imports.
Submission: You are not required to submit this project. However, there is a gradable available in Submitty.
Install Python 3.9. If you already have Python, please check that it is in the correct version.
To check if you meet our requirements, you can run:
python3 -V
If you need to install things, we recommend using a package manager (such as Conda) or the official installers for your OS.
If you choose to use Conda via Anaconda (recommended), you can follow their installation instructions.
If you run into issues, make sure:
You are using Python 3.9.
Your pip corresponds to the same Python installation as python3.
Your environment (Conda/venv) is activated if you are using one.
If you still have problems, ask on the course forum via Submitty or attend office hours.
This project includes a quick workflow setup guide.
For any later project, you will typically:
Download the project starter code.
Edit the required files.
Run the autograder locally.
Submit your final code.
You could use an autograder to test your solutions.
Typical usage pattern:
python3 autograder.py
In addition.py, implement a simple addition function.
The intended goal is to confirm:
You can edit Python files correctly
You can run the autograder to perform evaluation
In buyLotsOfFruit.py, implement buyLotsOfFruit(orderList).
The function should:
Take a list of (fruit, numPounds) tuples.
Compute and return the total cost.
Use the provided fruit prices dictionary.
If there is some fruit in the list which doesn’t appear in fruitPrices it should print an error message and return None.
Please do not change the fruitPrices variable. You can run the autograder to perform evaluation.
In shopSmart.py, implement shopSmart(orderList, fruitShops).
The function should:
Compare total cost of an order across multiple shops.
Return the shop that offers the lowest total cost.
Now, you can run the autograder to evalulate all three questions.
python3 autograder.py
This project is part of the CS 188 projects created by John DeNero, Dan Klein, Pieter Abbeel, and many others.