1. Engineering
  2. Computer Science
  3. hello can you please modify this turtle python program to...

Question: hello can you please modify this turtle python program to...

Question details
Hello! Can you please modify this turtle python program to draw the numbers 4 and 5. Numbers 1 and 2 are already in the program. Thanks!
----------
import turtle

# functions
def drawOne():
    # since we are drawing a 1, we are only going down 2 times
    numberDrawer.right (90) 
    for i in range (2):
        numberDrawer.stamp() #leave an impression on the canvas
        numberDrawer.forward(100)

def drawTwo():
    # since we are drawing a 2, we are
    # going right 1    
    numberDrawer.stamp()
    numberDrawer.forward(100)

    #going down 1
    numberDrawer.right (90) 
    numberDrawer.stamp() #leave an impression on the canvas
    numberDrawer.forward(100)
    
    #going left 1
    numberDrawer.right(90)
    numberDrawer.stamp()
    numberDrawer.forward(100)
    
    #going down 1
    numberDrawer.right (-90) 
    numberDrawer.stamp() #leave an impression on the canvas
    numberDrawer.forward(100)

    #going right 1
    numberDrawer.right(270)
    numberDrawer.stamp()
    numberDrawer.forward(100)
    
################################### main program 
wn = turtle.Screen()
wn.bgcolor("lightgreen")

numberDrawer = turtle.Pen() 
numberDrawer.color("blue")


# for more information on how to get input check out https://docs.python.org/3/library/turtle.html#input-methods
NumberChoice = turtle.numinput("get Input","please enter the number you want to draw", 1, 1, 2, 4)
if NumberChoice == 1:
    drawOne() # call the function which draws a 1
elif NumberChoice == 2:
    drawTwo()
#no other choices will be allowed.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution