Homework 1
Due Tuesday 26-Jan, at 8pm on Gradescope.
To start
- Create a folder named ‘hw1’
- Create a file name
hw1.py
- Edit
hw1.py
and add the functions as required
- When you have completed and fully tested hw1, submit hw1.py to Gradescope.
For this hw, you may submit as many times as you want up until the deadline, but only your last submission counts.
Some important notes
- This homework is solo. You may not collaborate or discuss it with anyone outside of the course,
and your options for discussing with other students currently taking the course are limited.
See the academic honesty policy for more details.
- After you submit to Gradescope, make sure you check the output. It should tell you that it was able to find all of the functions.
- Remember the course’s academic integrity policy. Solving the homework yourself is
your best preparation for exams and quizzes; cheating or short-cutting your learning
process in order to improve your homework score will actually hurt your course grade
long-term.
Problems
-
drawRect(length, height) [5 pts]
Write a function called drawRect that takes two input parameters: the length and height
of a rectangle. The function should then use the turtle commands to create a rectangle with
the dimensions according to the values passed in.
-
drawOne() [10 pts]
Write a function called drawOne that uses the turtle library to draw the number 1.
The pensize should be 3 and the height of the digit should be 24 units.
-
drawTwo() [10 pts]
Write a function called drawTwo that uses the turtle library to draw the number 2.
The pensize should be 3 and the height of the digit should be 24 units.
-
drawThree() [10 pts]
Write a function called drawThree that uses the turtle library to draw the number 3.
The pensize should be 3 and the height of the digit should be 24 units.
-
drawSix() [10 pts]
Write a function called drawSix that uses the turtle library to draw the number 6.
The pensize should be 3 and the height of the digit should be 24 units.
-
drawNine() [10 pts]
Write a function called drawNine that uses the turtle library to draw the number 9.
The pensize should be 3 and the height of the digit should be 24 units.
-
drawClock() [20 pts]
Use the draw numbers functions to create a clockface. Your function should be called drawClock. You output should be similar to the below:
-
drawClockTower() [25 pts]
Write a function called drawClockTower that uses the functions you've written so far to draw a clock tower as shown below: