Problem Set 2 - Due Tue Feb 8 at 23:00
Reading
- Lecture 3/4 slides and notebook
- Problems and solutions from Lab 2.
- Think Python, Chapter 3 covers functions, and Think Python, Chapter 6 covers fruitful functions, although sections 6.4 through 6.6 are material that we'll cover later.
- If you prefer an audio format, our podcast The Path to Programming has an episode for this week on Defining Functions.
Note that many of the same materials from last week are relevant this week again.
Tasks
The instructions for each task:
-
Task 1: Text in Boxes — Practice working with functions by writing some simple functions that use
input
andprint
. This is an individual task. -
Task 2: Diamonds — Use functions to avoid repeating code while printing out a repetitive pattern. For this problem, having a partner is optional but recommended.
-
Task 3: Monster Mash — Explore functions in the context of
turtle
graphics by drawing modular monsters. You may complete EITHER this task or the mixed melodies task, but you don't have to complete both. For this problem, having a partner is optional but recommended. - Task 4: Mixed-Up Melodies —
Explore functions in the context of
wavesynth
audio by composing modular melodies. You may complete EITHER this task or the monster mash task, but you don't have to complete both. For this problem, having a partner is optional but recommended.
About this Problem Set
This problem set will give you practice with defining custom functions
both for text-based interactive programs and for either drawing in
turtle
graphics or audio with wavesynth
.
Although there are four tasks listed above, you only need to complete three of them: the first two tasks, plus your choice of either the third or fourth task.
If you want to find a partner to work with for this problem set, use this Google Sheet to do so.
Reminders
- Remember to download the starter code for each task from the Potluck server.
- You can also use the server to take a 24-hour extension on this problem set if you need to.
- You should check the rubric for each task before you submit.
Time Estimate
Our per-task estimate for this pset is 1-2.5 hours, and our estimate for total time spent across all tasks is 4–8 hours, plus up to an hour of reading.
How to turn in this Problem Set
-
Upload your tasks via the Potluck server by the deadline (Tue Feb 8 at 23:00).
- For textInBoxes, submit
textInBoxes.py
. - For diamonds, each team member must submit
diamonds.py
. - For monsterMash, each team member must submit
monsterMash.py
. - For mixedUpMelodies, each team member must submit
mixedUpMelodies.py
.
- For textInBoxes, submit
-
Double-check the status of your submitted tasks, since there may be warnings.
-
Reminder: you can submit as many times as you like, and only the most recent submission will count for your grade.
-
If you run into trouble with the submissions server, contact Prof. Mawhorter, and include a copy of the file(s) you were trying to submit.
- After the deadline, check your score for each task and submit revisions if you need to.