Creating Mario character with python

Опубликовано: 10 Июнь 2026
на канале: SNACTHY SHORTS
333
7

Creating Mario character with python
Source code below:-
import turtle
import time
t = turtle.Turtle()
turtle.setup(450,500)
t.speed(100)
turtle.bgcolor("lightblue")
def square():
t.begin_fill()
for x in range (0,4):
t.fd(30)
t.left(90)
t.end_fill()
t.fd(30)
def two():
for x in range(0,2):
square()

def three():
for x in range(0,3):
square()

def four():
for x in range(0,4):
square()
def rotation():
t.left(90)
t.fd(60)
t.left(90)
t.hideturtle()
t.up()
t.goto(-180,-240)
t.color("brown")
four()
t.fd(120)
four()
rotation()
t.fd(30)
three()
t.fd(120)
three()
t.rt(180)
t.fd(30)
t.color("blue")
three()
t.fd(60)
three()
t.fd(60)
rotation()
t.color("orange")
two()
t.color("blue")
three()
two()
three()
t.color("orange")
two()
t.rt(180)
three()
t.color("blue")
three()
three()
t.color("orange")
three()
rotation()
two()
t.color("red")
square()
t.color("blue")
square()
t.color("yellow")
square()
t.color("blue")
two()
t.color("yellow")
square()
t.color("blue")
square()
t.color("red")
square()
t.color("orange")
two()
t.rt(180)
t.color("red")
four()
t.color("blue")
four()
t.color("red")
four()
rotation()
t.fd(30)
three()
t.color('blue')
square()
t.color("red")
two()
t.color("blue")
square()
t.color("red")
three()
t.rt(180)
t.fd(30)
two()
t.color("blue")
square()
t.color("red")
two()
t.color("blue")
square()
t.color("red")
two()
rotation()
t.fd(30)
t.color('orange')
three()
three()
t.fd(30)
t.rt(180)
t.color("brown")
square()
t.color("orange")
four()
t.color("black")
four()
t.fd(30)
rotation()
t.color("orange")
three()
t.color("black")
square()
t.color("orange")
three()
t.color("brown")
two()
t.color("orange")
square()
t.color("brown")
square()
t.rt(180)
square()
t.color("orange")
square()
t.color("brown")
square()
t.color("orange")
three()
t.color("black")
square()
t.color("orange")
three()
rotation()
t.fd(60)
square()
t.color("black")
square()
t.color("orange")
two()
t.color("brown")
three()
t.rt(180)
t.color("red")
four()
four()
square()
rotation()
t.fd(90)
three()
two()
The source code above is also in comment box use it from there to create your own #Mariocharacter in pyroid 3 application