PYTHON PROJECT: Draw shape and chose your color
In this project you wright a shape and a color and click enter a turtle wright this!(Codes are in the comments)
In this project you wright a shape and a color and click enter a turtle wright this!(Codes are in the comments)
Hello! I am Yusuf.I am twelve.I from Turkey. I will publish my projects.
4 comments
import turtle
ReplyDeletea = input("shape:")
b = input("color:")
ok = turtle.Turtle()
ok.shape("turtle")
ok.pensize(10)
ok.speed(5)
if b == "black":
ok.pencolor("black")
elif b == "blue":
ok.pencolor("blue")
elif b == "green":
ok.pencolor("green")
elif b == "red":
ok.pencolor("red")
elif b == "yellow":
ok.pencolor("yellow")
elif b == "pink":
ok.pencolor("pink")
elif b == "purple":
ok.pencolor("purple")
elif b == "orange":
ok.pencolor("orange")
elif b == "brown":
ok.pencolor("brown")
elif b == "dark blue":
ok.pencolor("darkblue")
elif b == "lightblue":
ok.pencolor("lightblue")
elif b == "lightyellow":
ok.pencolor("lightyellow")
elif b == "grey":
ok.pencolor("grey")
if a == "circle":
ok.penup()
ok.goto(-50, 0)
ok.pendown()
ok.circle(100)
ok.penup
ok.penup()
ok.goto(-50, 70)
ok.pencolor("black")
ok.pendown()
ok.circle(20)
elif a == "square":
for i in range(4):
ok.forward(100)
ok.left(90)
elif a == "triangle":
ok.right(60)
ok.forward(150)
ok.right(120)
ok.forward(160)
ok.right(120)
ok.forward(160)
elif a == "rectangle":
for i in range (2):
ok.forward(60)
ok.left(90)
ok.forward(130)
ok.left(90)
elif a == "Octagon":
for i in range (8):
ok.forward(100)
ok.left(45)
elif a == "graphic":
for i in range(1,20):
ok.pensize(5)
ok.forward(100)
ok.left(95)
elif a == "pentagon":
for i in range (5):
ok.forward(90)
ok.left(70)
elif a == "star":
for i in range (5):
ok.forward(200)
ok.right(144)
ok.screen.mainloop()
I love This project :)
ReplyDeleteLooks good
ReplyDeleteI love ıt
ReplyDelete