Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
from turtle import Turtle t= Turtle() #house t.color("orange") t.begin_fill() for counter in range(4): t.forward(90) t.rt(90) t.end_fill() #roof t.color("brown") t.begin_fill() t.left(50) t.forward(65) t.right(95) t.forward(70) t.penup() t.rt(45) t.forward(90) t.rt(90) t.forward(40) t.rt(90) t.end_fill() #door t.color("blue") t.begin_fill() t.pendown() t.forward(40) t.lt(90) t.forward(20) t.lt(90) t.forward(40) t.penup() t.rt(180) t.forward(60) t.left(90) t.pendown() t.end_fill() #windows t.color("red") for counter in range(4): t.forward(20) t.right(90) t.forward(10) t.right(90) t.forward(20) t.backward(10) t.right(90) t.forward(10) t.backward(20) t.penup() t.forward(40) t.pendown() t.forward(20) t.left(90) t.forward(10) t.left(90) t.forward(20) t.left(90) t.forward(20) t.left(90) t.forward(20) t.left(90) t.forward(10) t.left(90) t.forward(10) t.right(90) t.forward(10) t.backward(20) #chimney t.begin_fill() t.penup() t.forward(60) t.pendown() t.forward(20) t.right(90) t.forward(20) t.right(90) t.forward(40) t.end_fill() #door knob t.color("black") t.begin_fill() t.penup() t.forward(75) t.right(90) t.forward(35) t.circle(3) t.right(90) t.forward(150) t.right(90) t.forward(25) t.end_fill() t.color("gray") t.begin_fill() t.circle(15) t.forward(20) t.circle(15) t.right(90) t.forward(0) t.right(90) t.circle(15) t.forward(15) t.circle(15) t.forward(20) t.rt(90) t.fd(10) t.lt(90) t.circle(15) t.forward(50) t.right(90) t.forward(30) t.right(90) t.forward(50) t.circle(15) t.forward(20) t.circle(15) t.right(90) t.forward(0) t.right(90) t.circle(15) t.forward(15) t.circle(15) t.forward(20) t.rt(90) t.fd(10) t.lt(90) t.circle(15) t.end_fill()
perfecthouse.py
( around 129 lines python code )
Published By:
te5270
Published on
2017-07-18T13:55:31Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here