Python Turtle Python Logo Program | Turtle | VCMIT

by - March 15, 2020

Turtle Python Logo Program


INPUT

import turtle

l1 = [[0.0, -238.0], [92.6, -219.3], [168.3, -168.3], [219.3, -92.6], [238.0, 0.0], [219.3, 92.6], [168.3, 168.3], [92.6, 219.3], [0.0, 238.0], [-92.6, 219.3], [-168.3, 168.3], [-219.3, 92.6], [-238.0, 0.0], [-219.3, -92.6], [-168.3, -168.3], [-92.6, -219.3], [0.0, -238.0], [0.0, -256.0], [-99.6, -235.9], [-181.0, -181.0], [-235.9, -99.6], [-256.0, 0.0], [-235.9, 99.6], [-181.0, 181.0], [-99.6, 235.9], [0.0, 256.0], [99.6, 235.9], [181.0, 181.0], [235.9, 99.6], [256.0, 0.0], [235.9, -99.6], [181.0, -181.0], [99.6, -235.9], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0], [0.0, -256.0]]
l2 = [[-83.1, 17.3], [-64.3, 16.4], [-13.81, 32.1], [3.2, 70.7], [-18.9, 115.4], [-70.5, 130.1], [-76.5, 129.9], [-82.7, 129.3], [-82.7, 128.7], [-82.7, 128.1], [-93.8, 128.1], [-104.9, 128.1], [-104.9, 127.5], [-104.9, -128.6], [-82.7, -126.9], [-104.9, -128.6], [-104.8, 20.4]]
l3 = [[-82.7, 110.4], [-75.9, 111.0], [-69.7, 111.2], [-34.8, 101.6], [-20.8, 73.4], [-32.0, 46.1], [-63.8, 35.8], [-72.2, 36.1], [-82.7, 37.2], [-82.7, 38.3], [-82.7, -126.9], [-82.7, 110.4]]
l4 = [[81.7, -76.9], [58.9, -114.2], [25.0, -134.9], [21.13, -125.4], [17.2, -115.9], [42.5, -101.7], [58.0, -79.0], [33.8, -13.4], [9.63, 52.2], [22.3, 52.2], [35.0, 52.2], [52.6, -1.8], [70.2, -55.8], [87.9, -1.8], [105.6, 52.2], [117.6, 52.2], [129.6, 52.2], [105.7, -12.3], [81.7, -76.9], [81.7, -76.9]]
l5 = [[220.5, 96], [168.9, 96], [117.3, 96], [90.5, 107.1], [79.3, 134], [79.3, 180.7], [79.3, 227.5], [88.3, 227.5], [97.3, 227.5], [97.3, 180.7], [97.3, 134], [103.2, 119.9], [117.3, 114], [168.9, 114], [220.5, 114], [220.5, 105], [220.5, 96]]


def drawseg(l):
    turtle.pu()
    turtle.goto(l[0][0], l[0][1])
    turtle.pd()
    for a, b in l[1:]:
        turtle.goto(a, b)


drawseg(l1)
drawseg(l2)
drawseg(l3)
drawseg(l4)
drawseg(l5)
turtle.mainloop()


OUTPUT



You May Also Like

0 Comments