Project 0: Python and Autograder Tutorial

Introduction

Projects in this class use Python 3.

Project 0 will cover the following:

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.

Python Installation

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.

Troubleshooting

If you run into issues, make sure:

If you still have problems, ask on the course forum via Submitty or attend office hours.

Workflow and Setup

This project includes a quick workflow setup guide.

For any later project, you will typically:

Autograding

You could use an autograder to test your solutions.

Typical usage pattern:

python3 autograder.py

Q1: Addition

In addition.py, implement a simple addition function.

The intended goal is to confirm:

Q2: buyLotsOfFruit function

In buyLotsOfFruit.py, implement buyLotsOfFruit(orderList).

The function should:

Please do not change the fruitPrices variable. You can run the autograder to perform evaluation.

Q3: shopSmart function

In shopSmart.py, implement shopSmart(orderList, fruitShops).

The function should:

Autograding

Now, you can run the autograder to evalulate all three questions.

python3 autograder.py

Acknowledgements

This project is part of the CS 188 projects created by John DeNero, Dan Klein, Pieter Abbeel, and many others.