« All Events
9 AM – Indo – Intro To Python – Gamas
April 1, 2023 @ 9:00 am - 10:00 am
Today We Did
- We created draw_square function so we can reduce code duplication.
Homework
- Create 3 new files:
- April1_TurtleRectangleFunction.py
- Copy the rectangle codes from March25_TurtleBasic.py and create a function draw_rectangle(x,y, color) function.
- Call the function 5 times with different coordinates and different colors.
- April1_TurtleTriangleFunction.py
- Copy the rectangle codes from March25_TurtleBasic.py and create a function draw_triangle(x,y, color) function.
- Call the function 5 times with different coordinates and different colors.
- April1_TurtleOctagonFunction.py
- Copy the octagon codes from March25_TurtleBasic.py and create a function draw_octagon(x,y, color) function.
- Call the function 5 times with different coordinates and different colors.
- Above homework is very similar to how we did the draw_square function in the class. Hint: before creating the function, you first have to change the coordinate to start drawing from (0,0)