Assignment 2
Assignment 2
Objective:
Requirements:
In assignment 1, each one of you drew your student number and name with turtle, through the practice,
you should have learned how to control turtle.
In this assignment, you need to define functions to draw each of the letters/numbers in your name and
student number. For example, if you name is Amanpreet and your student number is 123235, you
should define functions for A, m, a, n, p, r, e, t, 1, 2, 3, 5.
Define a function to draw a dummy symbol to represent all the other characters.
Each letter/number including the dummy symbol should have different color.
Your program should prompt user to enter any characters/numbers in any sequence, no matter what
characters/numbers are entered, your program should print out neatly.
There are different ways to finish the task, I will introduce two ways below and you can use either of the
two or explore your own solution.
1. You need to make sure that each character’s starting point, ending point and the direction the
turtle is facing after drawing be consistent.
Starting point and ending point need to be consistent as
shown here (the direction your turtle is heading can’t be
shown here, but also need to be consistent, for example,
heading east, you can use seth() method, seth(0) will set the
direction to east). So it doesn’t matter number 1 is drawn
first or number 2 is drawn first; after the character is drawn,
we can simply make the turtle go to the next starting point
where the next character will be drawn.
2. Another way is to use a coordinate map(in your mind) to plan your character’s location; in this
case, you only need to pay attention to the characters’ starting point and the direction the
turtle is heading to, they (starting point and direction) need to be consistent.
Please make sure your drawing will be nicely displayed, which means your drawing should not be too
small or too big for computer screen.
Please upload your finished work (.py file) and the screen shot of running your program on Moodle.