This is a short homework. Therefore, it's due in one week.
This homework is designed to give you some practice in learning by observing. The topic that is covered is functions, which we haven't covered in class yet, so this homework is more like a preparation for next week.
Copy HW2-3a.py onto your computer. Rename it as Name_StudentID_HW2-3a.py
. (This it a new version that is better formatted. If you already completed your homework with the original version HW2-3.py, that's also fine.)_
Throughout the code, there are twelve commented questions (#Q1, #Q2, etc) scattered around. Answer the questions by writing comments into the program. Remember that you have to hand in a working program at the end!
Hand in Name_StudentID_HW2-3a.py
(or Name_StudentID_HW2-3.py
) by sharing the files with PolyUCOMP1D04@gmail.com
.
Note: Before you turn in your Python files, make sure they run without any errors(Save your Python file. Then select Run > Run Module
or hit F5
on your keyboard)! If nothing appears in the Shell, don't worry as long as no red error messages appear. If they don't run, i.e. if red stuff starts appearing in the shell, points will be taken off!