generated from mwc/project_drawing
I drew code to get the shape of my skyscraper.
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.
This commit is contained in:
28
drawing.py
28
drawing.py
@@ -1,7 +1,31 @@
|
|||||||
# drawing.py
|
# drawing.py
|
||||||
# ----------
|
# ----------
|
||||||
# By ____(you)___________
|
# By Jannatun Uddin
|
||||||
#
|
#
|
||||||
# (Briefly describe what this program does.)
|
# (Briefly describe what this program does.)
|
||||||
|
|
||||||
from turtle import *
|
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()
|
||||||
Reference in New Issue
Block a user