Python Turtle - Code a Boat Tutorial

preview_player
Показать описание
Learn how to code a boat using Python's Turtle module.

~ CODE ~

from turtle import *

setup(800, 500)
speed(0)

# Sky
bgcolor("lightskyblue")

# Water
penup()
goto(-400, -150)
pendown()
color("mediumblue")
begin_fill()
for i in range(2):
forward(800)
right(90)
forward(100)
right(90)
end_fill()

# Boat
penup()
goto(-200, -80)
pendown()
color("saddlebrown")
begin_fill()
right(45)
forward(100)
left(45)
forward(250)
left(45)
forward(100)
end_fill()

# Mast
penup()
goto(0, -80)
pendown()
color("black")
begin_fill()
left(45)
for i in range(2):
forward(200)
left(90)
forward(10)
left(90)
end_fill()

# Right Sail
penup()
goto(0, 120)
pendown()
color("white")
begin_fill()
right(130)
forward(250)
right(140)
forward(190)
end_fill()

# Left Sail
penup()
forward(14)
pendown()
begin_fill()
forward(180)
right(139)
forward(240)
end_fill()

# Sun
penup()
goto(-300, 150)
pendown()
color("yellow")
begin_fill()
circle(40)
end_fill()

hideturtle()
Рекомендации по теме
Комментарии
Автор

Thank you for the tutorial. These projects are a fun way learn python coding.

navysteel
Автор

Wow, this is cool and super amazing sir !

tinajain
Автор

I'm doing it in vs code but it is different how you was writing the code in the video thanks for this video

jawadsikander
Автор

You should've made this before we did it lmao

heavydiesel
Автор

thanks so much, this really helped!! however, is there a solution to having the shape being drawn on our current page, as it usually is??

jasminegokaydin
visit shbcf.ru