Friday, 31 December 2021

Happy New Year 2022 in Python using Turtle Library



Code:  



import turtle
turtle.setup(1000, 1000, 0, 0)
t = turtle.Turtle()
t.width(12)
t.color("maroon")
s = turtle.getscreen()
t.speed(2)
s.bgcolor("azure")
#clcoding.com
t.left(180)
t.penup()
t.forward(300)
t.right(90)
t.forward(100)
t.pendown()

t.forward(50)
t.right(90)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.penup()
t.forward(50)
t.left(90)
t.pendown()
t.forward(50)
t.left(90)
t.forward(50)
t.right(90)
t.forward(50)

t.penup()
t.left(90)
t.forward(15)
t.pendown()
t.left(70)
t.forward(110)
t.right(70)
t.right(70)
t.forward(110)
t.left(180)
t.forward(55)
t.left(70)
t.forward(38)
t.left(70)
t.penup()
t.forward(55)
t.left(110)

t.forward(100)
t.left(90)
t.pendown()
t.forward(100)
t.right(90)
t.forward(50)
t.right(20)
t.forward(20)
t.right(70)
t.forward(40)
t.right(70)
t.forward(20)
t.right(20)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.penup()
t.forward(100)

t.left(90)
t.pendown()
t.forward(100)
t.right(90)
t.forward(50)
t.right(20)
t.forward(20)
t.right(70)
t.forward(40)
t.right(70)
t.forward(20)
t.right(20)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.penup()
t.forward(100)

t.forward(20)
t.pendown()
t.left(90)
t.forward(50)
t.left(30)
t.forward(60)
t.backward(60)
t.right(60)
t.forward(60)
t.backward(60)
t.left(30)

t.penup()
t.home()
t.color("blue")

t.backward(300)
t.right(90)
t.forward(60)
t.left(180)

t.pendown()
t.forward(100)
t.right(160)
t.forward(100)
t.left(160)
t.forward(100)

t.penup()
t.home()

t.backward(240)
t.right(90)
t.forward(10)
t.pendown()
t.forward(50)
t.left(90)
t.forward(50)
t.backward(50)
t.left(90)
t.forward(100)
t.right(90)
t.forward(50)
t.backward(50)
t.right(90)
t.forward(50)
t.left(90)
t.forward(50)
t.penup()
t.home()

t.backward(150)
t.right(90)
t.forward(60)
t.pendown()
t.backward(100)
t.forward(100)
t.left(120)
t.forward(40)
t.right(60)
t.forward(40)
t.left(120)
t.forward(100)
t.penup()
t.home()

t.backward(30)
t.right(90)
t.forward(65)
t.left(90)

t.pendown()
t.left(90)
t.forward(50)
t.left(30)
t.forward(60)
t.backward(60)
t.right(60)
t.forward(60)
t.backward(60)
t.left(30)

t.penup()
t.home()

t.forward(10)
t.right(90)
t.forward(10)
t.pendown()
t.forward(50)
t.left(90)
t.forward(50)
t.backward(50)
t.left(90)
t.forward(100)
t.right(90)
t.forward(50)
t.backward(50)
t.right(90)
t.forward(50)
t.left(90)
t.forward(50)
t.penup()
t.home()

t.forward(90)
t.right(90)
t.forward(50)
t.left(90)
t.pendown()
t.left(70)
t.forward(110)
t.right(70)
t.right(70)
t.forward(110)
t.left(180)
t.forward(55)
t.left(70)
t.forward(38)
t.left(70)
t.penup()
t.forward(55)
t.left(110)

t.forward(100)
t.penup()
t.home()
t.forward(180)
t.right(90)
t.forward(50)
t.left(180)
t.pendown()
t.forward(100)
t.right(90)
t.forward(50)
t.right(20)
t.forward(20)
t.right(70)
t.forward(40)
t.right(70)
t.forward(20)
t.right(20)
t.forward(50)
t.left(180)
t.forward(50)
t.right(20)
t.forward(20)
t.right(70)
t.forward(40)
t.left(180)
t.penup()
t.home()

t.right(90)
t.forward(215)
t.right(90)
t.forward(170)
t.color("green")
t.penup()
t.home()
t.home()
t.forward(370)
t.pendown()
t.color("magenta")
t.width(3)
t.speed(0)

def squre(length, angle):
    t.forward(length)
    t.right(angle)
    t.forward(length)
    t.right(angle)

    t.forward(length)
    t.right(angle)
    t.forward(length)
    t.right(angle)
squre(80, 90)

for i in range(36):
    t.right(10)
    squre(80, 90)

t.penup()
t.home()
t.left(90)
t.forward(270)
t.left(90)
t.forward(200)
t.pendown()

t.penup()
t.setpos(-270,-120)
t.pendown()
t.pencolor('red')
t.write('Happy New Year 2022 ',font=("Algerian", 24, "normal"))
turtle.mainloop()




Join us: https://t.me/jupyter_python

0 Comments:

Post a Comment

Popular Posts

Categories

AI (32) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (146) C (77) C# (12) C++ (82) Course (67) Coursera (198) Cybersecurity (24) data management (11) Data Science (106) Data Strucures (8) Deep Learning (13) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (21) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (46) Meta (18) MICHIGAN (5) microsoft (4) Nvidia (1) Pandas (3) PHP (20) Projects (29) Python (888) Python Coding Challenge (285) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (42) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses