Tuesday, May 4, 2021

 

Draw SHINCHAN with Python Turtle



Source Code:-


  1. from turtle import *
  2. #import time
  3. s=Screen()
  4. s.screensize(700,1000)
  5. speed(5)
  6. def myPosition(x, y):
  7.     penup()
  8.     goto(x, y)
  9.     pendown()
  10. #time.sleep(10)
  11. #ht()
  12. pensize(2)
  13. def rohit():
  14.     fillcolor('#ffec40')
  15.     begin_fill()
  16.     right(25)
  17.     forward(20)
  18.     right(45)
  19.     forward(20)
  20.     left(70)
  21.     forward(90)
  22.     left(95)
  23.     forward(75)
  24.     left(85)
  25.     forward(175)
  26.     left(85)
  27.     forward(75)
  28.     left(95)
  29.     forward(90)
  30.     left(85)
  31.     forward(18)
  32.     end_fill()

  33. def leftLeg():
  34.     myPosition(-39,-25)
  35.     fillcolor("#ffd699")
  36.     begin_fill()
  37.     right(89)
  38.     forward(25)
  39.     right(90)
  40.     forward(50)
  41.     right(90)
  42.     forward(20)
  43.     right(85)
  44.     forward(50)
  45.     end_fill()

  46. def leftSock():
  47.     myPosition(-36,-78)
  48.     fillcolor("#ffffff")
  49.     begin_fill()
  50.     right(90)
  51.     circle(80,13)
  52.     right(110)
  53.     forward(22)
  54.     right(85)
  55.     forward(19)
  56.     right(90)
  57.     forward(21)
  58.     end_fill()

  59. def leftShoe():
  60.     myPosition(-69,-112)
  61.     fillcolor("#b5ae60")
  62.     begin_fill()
  63.     right(90)
  64.     left(5)
  65.     forward(56)
  66.     left(105)
  67.     forward(13)
  68.     left(75)
  69.     forward(20)
  70.     right(90)
  71.     forward(15)
  72.     circle(10,15)
  73.     left(80)
  74.     forward(4)
  75.     circle(10,15)
  76.     left(40)
  77.     circle(20,15)
  78.     forward(10)
  79.     right(45)
  80.     forward(15)
  81.     circle(25,25)
  82.     end_fill()

  83. def rightLeg():
  84.     myPosition(60,-28)
  85.     fillcolor("#ffd699")
  86.     begin_fill()
  87.     #right(90)
  88.     left(128)
  89.     forward(25)
  90.     right(95)
  91.     forward(55)
  92.     right(90)
  93.     forward(20)
  94.     right(85)
  95.     forward(55)
  96.     end_fill()

  97. def rightSock():
  98.     myPosition(64,-79)
  99.     fillcolor("#ffffff")
  100.     begin_fill()
  101.     right(90)
  102.     circle(90,14)
  103.     right(110)
  104.     forward(23)
  105.     right(90)
  106.     forward(15)
  107.     right(80)
  108.     forward(21)
  109.     end_fill()

  110. def rightShoe():
  111.     myPosition(64,-108)
  112.     fillcolor("#b5ae60")
  113.     begin_fill()
  114.     right(100)
  115.     forward(56)
  116.     left(160)
  117.     forward(25)
  118.     right(68)
  119.     forward(17)
  120.     left(90)
  121.     circle(18,15)
  122.     forward(5)
  123.     left(75)
  124.     forward(11)
  125.     right(85)
  126.     forward(20)
  127.     left(45)
  128.     circle(10,30)
  129.     left(25)
  130.     forward(5)
  131.     end_fill()

  132. def myShirt():
  133.     myPosition(-75,48)
  134.     fillcolor("red")
  135.     begin_fill()
  136.     left(72)
  137.     forward(185)
  138.     left(87)
  139.     forward(75)
  140.     right(68)
  141.     circle(20,8)
  142.     circle(300,23)
  143.     left(90)
  144.     circle(35,17)
  145.     right(38)
  146.     circle(35,17)
  147.     left(58)
  148.     forward(75)
  149.     right(12)
  150.     forward(140)
  151.     right(40)
  152.     forward(93)
  153.     left(120)
  154.     circle(-20,65)
  155.     left(75)
  156.     forward(10)
  157.     left(23)
  158.     forward(88)
  159.     #circle(-80,10)
  160.     right(31)
  161.     forward(87)
  162.     right(180)
  163.     forward(108)
  164.     right(180)
  165.     forward(104)
  166.     circle(10,70)
  167.     end_fill()

  168. def myHead():
  169.     myPosition(-20,295)
  170.     left(20)
  171.     pensize(2)
  172.     fillcolor('#fcc6a0')
  173.     begin_fill()
  174.     right(90)
  175.     forward(40)
  176.     right(90)
  177.     circle(50,80)
  178.     left(10)
  179.     circle(50,80)
  180.     left(2)
  181.     circle(200,50)

  182.     left(48)
  183.     forward(60)
  184.     #left(20)
  185.     circle(45,60)
  186.     right(5)
  187.     circle(100,85)
  188.     end_fill()
  189.     fillcolor('black')
  190.     begin_fill()

  191.     pensize(2)
  192.     right(170)
  193.     circle(-100,165)
  194.     right(78)
  195.     forward(26)
  196.     right(87)
  197.     forward(55)
  198.     circle(45,60)
  199.     right(5)
  200.     circle(100,85)
  201.     end_fill()

  202.     fillcolor('#fcc6a0')
  203.     begin_fill()
  204.     right(180)
  205.     circle(-100,105)
  206.     right(37)
  207.     forward(49)
  208.     pensize(2)
  209.     left(130)
  210.     forward(30)
  211.     #right(5)
  212.     circle(-10,70)
  213.     right(50)
  214.     #circle(10,10)
  215.     forward(36)
  216.     right(80)
  217.     forward(50)
  218.     pencolor('#fcc6a0')
  219.     right(90)
  220.     forward(30)
  221.     
  222.     end_fill()

  223. def rightHand():
  224.     #left(35)
  225.     myPosition(197,209)
  226.     pencolor('black')
  227.     fillcolor('#fcc6a0')
  228.     begin_fill()
  229.     right(45)
  230.     forward(6)
  231.     left(55)
  232.     forward(20)
  233.     circle(-5,70)
  234.     right(100)
  235.     forward(18)
  236.     left(105)
  237.     forward(18)
  238.     circle(-5,70)
  239.     right(100)
  240.     forward(18)
  241.     left(145)
  242.     forward(15)
  243.     circle(-5,70)
  244.     right(100)
  245.     forward(18)

  246.     left(150)
  247.     forward(13)
  248.     circle(-5,70)
  249.     right(100)
  250.     forward(15)

  251.     left(150)
  252.     forward(10)
  253.     circle(-5,70)
  254.     right(100)
  255.     forward(12)
  256.     circle(60,10)
  257.     left(45)
  258.     forward(6)
  259.     right(90)
  260.     forward(10)
  261.     end_fill()

  262. def leftHand():
  263.     myPosition(-94,242)
  264.     fillcolor('#fcc6a0')
  265.     begin_fill()
  266.     right(10)
  267.     forward(6)
  268.     left(90)
  269.     penup()
  270.     forward(12)
  271.     pendown()
  272.     left(90)
  273.     forward(8)
  274.     left(90)
  275.     forward(12)
  276.     end_fill()

  277. def myBis():
  278.     myPosition(-103,291)
  279.     right(90)
  280.     fillcolor('#02d302')
  281.     begin_fill()
  282.     right(90)
  283.     forward(55)
  284.     left(80)
  285.     forward(12)
  286.     left(10)
  287.     forward(17)
  288.     left(10)
  289.     forward(12)
  290.     left(80)
  291.     forward(55)
  292.     left(80)
  293.     forward(12)
  294.     left(10)
  295.     forward(17)
  296.     left(10)
  297.     forward(12)
  298.     left(80)
  299.     left(80)
  300.     forward(12)
  301.     left(10)
  302.     forward(17)
  303.     left(10)
  304.     forward(12)
  305.     end_fill()
  306.     penup()
  307.     right(100)
  308.     forward(20)
  309.     right(90)
  310.     forward(14)
  311.     pendown()
  312.     pencolor('#9c5e4a')
  313.     fillcolor('#9c5e4a')
  314.     begin_fill()
  315.     for i in range(5):
  316.         forward(15)
  317.         right(144)
  318.     end_fill()
  319.     penup()
  320.     forward(27)
  321.     left(90)
  322.     forward(16)
  323.     left(90)
  324.     forward(7)
  325.     pendown()
  326.     fillcolor('#9c5e4a')
  327.     begin_fill()
  328.     for i in range(5):
  329.         forward(10)
  330.         right(144)
  331.     end_fill()
  332.     penup()
  333.     forward(20)
  334.     right(90)
  335.     forward(5)
  336.     pendown()
  337.     fillcolor('#9c5e4a')
  338.     begin_fill()
  339.     for i in range(5):
  340.         forward(10)
  341.         right(144)
  342.     end_fill()
  343.     penup()
  344.     right(180)
  345.     forward(6)
  346.     pendown()
  347.     fillcolor('#9c5e4a')
  348.     begin_fill()
  349.     for i in range(5):
  350.         forward(10)
  351.         right(144)
  352.     end_fill()

  353. def leftHand2():
  354.     myPosition(-112,284)
  355.     pencolor('black')
  356.     fillcolor('#fcc6a0')
  357.     begin_fill()
  358.     right(180)
  359.     forward(31)
  360.     left(90)
  361.     for i in range(2): 
  362.         circle(4,90) 
  363.         #circle(4//2,45)
  364.     for i in range(3):
  365.         right(180)
  366.         for i in range(2): 
  367.             circle(4,90)
  368.     end_fill()

  369. def myMouth():
  370.     myPosition(-25,200)
  371.     left(65)
  372.     fillcolor('#77332e')
  373.     begin_fill()
  374.     #circle(20)
  375.     #forward(20)
  376.     for i in range(2): 
  377.         circle(25,90) 
  378.         circle(25//2,90)
  379.     end_fill()

  380. def myEyebrow(x,y):
  381.     myPosition(x,y)
  382.     pensize(18)
  383.     right(150)
  384.     forward(25)
  385.     right(90)
  386.     for i in range(1):
  387.         right(45)
  388.         dot(15)
  389.     left(55)
  390.     forward(25)
  391.     for i in range(1):
  392.         right(45)
  393.         dot(15)

  394. def myEyelid(x,y):
  395.     myPosition(x,y)
  396.     pensize(2)
  397.     left(170)
  398.     circle(-23,180)

  399. def myallEyes1(x,y):
  400.     myPosition(x,y)
  401.     right(90)
  402.     fillcolor('#000000')
  403.     begin_fill()
  404.     circle(18)
  405.     end_fill()
  406.     left(90)
  407.     penup()
  408.     forward(19)
  409.     right(90)
  410.     forward(7)
  411.     pendown()
  412.     fillcolor('#ffffff')
  413.     begin_fill()
  414.     left(90)
  415.     circle(9)
  416.     end_fill()

  417. def myallEyes2(x,y):
  418.     myPosition(x,y)
  419.     right(90)
  420.     fillcolor('#000000')
  421.     begin_fill()
  422.     circle(18)
  423.     end_fill()
  424.     left(90)
  425.     penup()
  426.     forward(19)
  427.     right(90)
  428.     forward(8)
  429.     pendown()
  430.     fillcolor('#ffffff')
  431.     begin_fill()
  432.     left(90)
  433.     circle(9)
  434.     end_fill()

  435. def myRobot():
  436.     myPosition(155,-105)
  437.     left(93)
  438.     color('red')
  439.     pensize(7)

  440.     begin_fill()
  441.     forward(50)
  442.     left(90)
  443.     forward(50)
  444.     left(90)
  445.     forward(50)
  446.     left(90)
  447.     forward(50)
  448.     left(90)
  449.     end_fill()


  450.     color('white')
  451.     penup()
  452.     left(90)
  453.     forward(30)
  454.     right(90)
  455.     forward(12)
  456.     pendown()
  457.     pensize(3)
  458.     circle(5)
  459.     penup()
  460.     forward(25)
  461.     pendown()
  462.     circle(5)

  463.     penup()
  464.     right(90)
  465.     forward(20)
  466.     right(90)
  467.     pendown()

  468.     begin_fill()
  469.     forward(23)
  470.     right(90)
  471.     forward(7)
  472.     right(90)
  473.     forward(23)
  474.     right(90)
  475.     forward(7)
  476.     right(90)
  477.     end_fill()

  478.     penup()
  479.     forward(25)
  480.     right(90)
  481.     forward(35)
  482.     pendown()

  483.     color('red')
  484.     forward(30)
  485.     penup()
  486.     right(90)
  487.     pendown()
  488.     begin_fill()
  489.     circle(5)
  490.     end_fill()

  491. def allLegs():
  492.     leftLeg()
  493.     leftSock()
  494.     leftShoe()
  495.     rightLeg()
  496.     rightSock()
  497.     rightShoe()
  498. def allHands():
  499.     rightHand()
  500.     leftHand()
  501.     myBis()
  502.     leftHand2()
  503. def allEyebrows():
  504.     myEyebrow(-8,300)
  505.     right(90)
  506.     myEyebrow(72,300)
  507.     myEyelid(-9,270)
  508.     left(15)
  509.     myEyelid(68,265)    
  510. def allEyes():
  511.     myallEyes1(17,275)
  512.     myallEyes2(95,270)
  513. rohit()
  514. allLegs()
  515. myShirt()
  516. myHead()
  517. allHands()
  518. myMouth()
  519. allEyebrows()
  520. allEyes()
  521. myRobot()
  522. ht()
  523. done()



OUTPUT





CHECK THESE SOURCE CODE ALSO 👇👇
👉👉👉Shinchan Code👈👈👈
👉👉👉iron man helmet code👈👈👈
👉👉👉Doraemon Code👈👈👈
👉👉👉Pikachu Code👈👈👈
👉👉👉Star Pattern👈👈👈
👉👉👉Dino Game Hack👈👈👈
👉👉👉Captain America Shield👈👈👈

4 comments:

  1. Hey can u plz tell.. which software we need for this.. and plz tell me the whole process for how to run that code.

    ReplyDelete
  2. Last month, when i visited your blog i got an error on the mysql server of yours.*~,”* https://python.engineering/python-workout-50-ten-minute-exercises/

    ReplyDelete