American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Intro To Python – Darin

October 17 @ 5:00 pm - 6:00 pm

Today We Do

  1. We continued learning the basics of Python Digital drawing using Turtle.

Homework

  1. Create a new file “Oct17_Turtle3FunctionsHW.py”
  2. Look at this image for your coordinates guidance
  3. Draw the Square, Rectangle, and Triangle using a shape function. The Square function has been defined in class, but the other two you will have to create.
  4. def drawSquare(x, y, size, c):
       t.penup()
       t.goto(x, y)
       t.pendown()
    
       t.color(c)
    
       t.begin_fill()
       for i in range(4):
          t.forward(size)
          t.right(90)
       t.end_fill()
    
    drawSquare(-200, 200, 10, "black")
    drawSquare(50, 200, 100, "green")
    
    # to make a new shape function, modify only the part that draws
    # modify whatever is in the for loop.
    
    Hint: Start by drawing the rectangle and triangle with just t.forward() and t.right()/t.left() and then simplify the code with for loops, this will be the main meat of your drawing functions

 

Notes:

You can reach me at ddjapri@ayclogic.com.

All class notes can be found here: https://drive.google.com/drive/folders/1ClxGyA_3oLZtwhgN0j3BVZjpffoxMHNj?usp=sharing

Details

Date:
October 17
Time:
5:00 pm - 6:00 pm
Event Categories:
,