generated from mwc/project_drawing
I got stuck on opening the drawing.py file. I figured out later that i can't open because the file in empty so I used code . to code VS to writr the code. I'm wondering if I can change my project a little from what I wrote in READ.MD. I want to learn more about how to draw a shape inside a shape in turtle. For future projects, I want to draw a figure sleeping.
31 lines
516 B
Python
31 lines
516 B
Python
# drawing.py
|
|
# ----------
|
|
# By Jannatun Uddin
|
|
#
|
|
# (Briefly describe what this program does.)
|
|
|
|
import turtle
|
|
def draw_building(width, height):
|
|
for i in range(2):
|
|
turtle.forward(width)
|
|
turtle.left(90)
|
|
turtle.forward(height)
|
|
turtle.left(90)
|
|
turtle.penup()
|
|
turtle.backward(90)
|
|
turtle.pendown()
|
|
|
|
draw_building(60,150)
|
|
|
|
turtle.penup()
|
|
turtle.forward(90)
|
|
turtle.pendown()
|
|
|
|
draw_building(40,100)
|
|
|
|
turtle.penup()
|
|
turtle.forward(30)
|
|
turtle.pendown()
|
|
|
|
draw_building(50,150)
|
|
turtle.done() |