Posts

drawing-doraemon-with-python-turtle

Image
  coding for pickachu from turtle import * # Doraemon with Python Turtle def ankur (x , y): penup() goto(x , y) pendown() def aankha (): fillcolor( "#ffffff" ) begin_fill() tracer( False ) a = 2.5 for i in range ( 120 ): if 0 <= i < 30 or 60 <= i < 90 : a -= 0.05 lt( 3 ) fd(a) else : a += 0.05 lt( 3 ) fd(a) tracer( True ) end_fill() def daari (): ankur(- 32 , 135 ) seth( 165 ) fd( 60 ) ankur(- 32 , 125 ) seth( 180 ) fd( 60 ) ankur(- 32 , 105 ) seth( 193 ) fd( 60 ) ankur( 37 , 125 ) seth( 15 ) fd( 60 ) ankur( 37 , 115 ) seth( 0 ) fd( 60 ) ankur( 37 , 105 ) seth(- 13 ) fd( 60 ) def mukh (): ankur( 5 , 138 ) seth( 270 ) fd( 100 ) seth( 0 ) circle( 120 , 50 ) seth( 230 ) circle(- 120 , 100 ) def muflar (): fillcolor( '#e70010' )

drawing-kikachu-with-python-turtle

Image
  coding for pickachu import turtle def gajurel(x, y): turtle.setx(x) turtle.sety(y) print(x, y) class Cartoon: def __init__(self): self.t = turtle.Turtle() t = self.t t.pensize(3) t.speed(9) t.ondrag(gajurel) def meme(self, x, y): self.t.penup() self.t.goto(x, y) self.t.pendown() def aankha1(self, x, y): self.meme(x, y) t = self.t t.seth(0) t.fillcolor('#333333') t.begin_fill() t.circle(22) t.end_fill() self.meme(x, y + 10) t.fillcolor('#000000') t.begin_fill() t.circle(10) t.end_fill() self.meme(x + 6, y + 22) t.fillcolor('#ffffff') t.begin_fill() t.circle(10) t.end_fill() def aankha2(self, x, y): self.meme(x, y) t = self.t t.seth(0) t.fillcolor('#333333') t.begin_fill()

drawing-captain-america-shield-with-python-turtle

Image
  code for captain America shield import turtle import math t = turtle.Turtle() def ankur(x, y): t.penup() t.goto(x, y) t.pendown() t.setheading(0) t.pensize(2) t.speed(10) def golo(r, color): x_point = 0 y_pont = -r ankur(x_point, y_pont) t.pencolor(color) t.fillcolor(color) t.begin_fill() t.circle(r) t.end_fill() def paanch(r, color): ankur(0, 0) t.pencolor(color) t.setheading(162) t.forward(r) t.setheading(0) t.fillcolor(color) t.begin_fill() for i in range(5): t.forward(math.cos(math.radians(18)) * 2 * r) # 2cos18°*r t.right(144) t.end_fill() t.hideturtle() if __name__ == '__main__': golo(288, 'crimson') golo(234, 'snow') golo(174, 'crimson') golo(114, 'blue') paanch(114, 'snow') turtle.done() Copy Code import turtle import math t = turtle.Turtle() def ankur (x , y): t.penup()