[go: up one dir, main page]

0% found this document useful (0 votes)
27 views7 pages

Draw Doraemon Using Python

Code book draw doraemon using python language.

Uploaded by

MOHSIN SIDDIQUI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views7 pages

Draw Doraemon Using Python

Code book draw doraemon using python language.

Uploaded by

MOHSIN SIDDIQUI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

from turtle import *


2.
3.
4. # Doraemon source code by Pythoncodess
5. def ankur(x, y):
6. penup()
7. goto(x, y)
8. pendown()
9.
10.
11. def aankha():
12. fillcolor("#ffffff")
13. begin_fill()
14.
15. tracer(False)
16. a = 2.5
17. for i in range(120):
18. if 0 <= i < 30 or 60 <= i < 90:
19. a -= 0.05
20. lt(3)
21. fd(a)
22. else:
23. a += 0.05
24. lt(3)
25. fd(a)
26. tracer(True)
27. end_fill()
28.
29.
30. def daari():
31. ankur(-32, 135)
32. seth(165)
33. fd(60)
34.
35. ankur(-32, 125)
36. seth(180)
37. fd(60)
38.
39. ankur(-32, 115)
40. seth(193)
41. fd(60)
42.
43. ankur(37, 135)
44. seth(15)
45. fd(60)
46.
47. ankur(37, 125)
48. seth(0)
49. fd(60)
50.
51. ankur(37, 115)
52. seth(-13)
53. fd(60)
54.
55.
56. def mukh():
57. ankur(5, 148)
58. seth(270)
59. fd(100)
60. seth(0)
61. circle(120, 50)
62. seth(230)
63. circle(-120, 100)
64.
65.
66. def muflar():
67. fillcolor('#e70010')
68. begin_fill()
69. seth(0)
70. fd(200)
71. circle(-5, 90)
72. fd(10)
73. circle(-5, 90)
74. fd(207)
75. circle(-5, 90)
76. fd(10)
77. circle(-5, 90)
78. end_fill()
79.
80.
81. def nak():
82. ankur(-10, 158)
83. seth(315)
84. fillcolor('#e70010')
85. begin_fill()
86. circle(20)
87. end_fill()
88.
89.
90. def black_aankha():
91. seth(0)
92. ankur(-20, 195)
93. fillcolor('#000000')
94. begin_fill()
95. circle(13)
96. end_fill()
97.
98. pensize(6)
99. ankur(20, 205)
100. seth(75)
101. circle(-10, 150)
102. pensize(3)
103.
104. ankur(-17, 200)
105. seth(0)
106. fillcolor('#ffffff')
107. begin_fill()
108. circle(5)
109. end_fill()
110. ankur(0, 0)
111.
112.
113. def face():
114. fd(183)
115. lt(45)
116. fillcolor('#ffffff')
117. begin_fill()
118. circle(120, 100)
119. seth(180)
120. # print(pos())
121. fd(121)
122. pendown()
123. seth(215)
124. circle(120, 100)
125. end_fill()
126. ankur(63.56, 218.24)
127. seth(90)
128. aankha()
129. seth(180)
130. penup()
131. fd(60)
132. pendown()
133. seth(90)
134. aankha()
135. penup()
136. seth(180)
137. fd(64)
138.
139.
140. def taauko():
141. penup()
142. circle(150, 40)
143. pendown()
144. fillcolor('#00a0de')
145. begin_fill()
146. circle(150, 280)
147. end_fill()
148.
149.
150. def Doraemon():
151. taauko()
152.
153. muflar()
154.
155. face()
156.
157. nak()
158.
159. mukh()
160.
161. daari()
162.
163. ankur(0, 0)
164.
165. seth(0)
166. penup()
167. circle(150, 50)
168. pendown()
169. seth(30)
170. fd(40)
171. seth(70)
172. circle(-30, 270)
173.
174. fillcolor('#00a0de')
175. begin_fill()
176.
177. seth(230)
178. fd(80)
179. seth(90)
180. circle(1000, 1)
181. seth(-89)
182. circle(-1000, 10)
183.
184. # print(pos())
185.
186. seth(180)
187. fd(70)
188. seth(90)
189. circle(30, 180)
190. seth(180)
191. fd(70)
192.
193. # print(pos())
194. seth(100)
195. circle(-1000, 9)
196.
197. seth(-86)
198. circle(1000, 2)
199. seth(230)
200. fd(40)
201.
202. # print(pos())
203.
204. circle(-30, 230)
205. seth(45)
206. fd(81)
207. seth(0)
208. fd(203)
209. circle(5, 90)
210. fd(10)
211. circle(5, 90)
212. fd(7)
213. seth(40)
214. circle(150, 10)
215. seth(30)
216. fd(40)
217. end_fill()
218.
219. seth(70)
220. fillcolor('#ffffff')
221. begin_fill()
222. circle(-30)
223. end_fill()
224.
225. ankur(103.74, -182.59)
226. seth(0)
227. fillcolor('#ffffff')
228. begin_fill()
229. fd(15)
230. circle(-15, 180)
231. fd(90)
232. circle(-15, 180)
233. fd(10)
234. end_fill()
235.
236. ankur(-96.26, -182.59)
237. seth(180)
238. fillcolor('#ffffff')
239. begin_fill()
240. fd(15)
241. circle(15, 180)
242. fd(90)
243. circle(15, 180)
244. fd(10)
245. end_fill()
246.
247. ankur(-133.97, -91.81)
248. seth(50)
249. fillcolor('#ffffff')
250. begin_fill()
251. circle(30)
252. end_fill()
253. # Doraemon with Python Turtle
254.
255. ankur(-103.42, 15.09)
256. seth(0)
257. fd(38)
258. seth(230)
259. begin_fill()
260. circle(90, 260)
261. end_fill()
262.
263. ankur(5, -40)
264. seth(0)
265. fd(70)
266. seth(-90)
267. circle(-70, 180)
268. seth(0)
269. fd(70)
270.
271. ankur(-103.42, 15.09)
272. fd(90)
273. seth(70)
274. fillcolor('#ffd200')
275. # print(pos())
276. begin_fill()
277. circle(-20)
278. end_fill()
279. seth(170)
280. fillcolor('#ffd200')
281. begin_fill()
282. circle(-2, 180)
283. seth(10)
284. circle(-100, 22)
285. circle(-2, 180)
286. seth(180 - 10)
287. circle(100, 22)
288. end_fill()
289. goto(-13.42, 15.09)
290. seth(250)
291. circle(20, 110)
292. seth(90)
293. fd(15)
294. dot(10)
295. ankur(0, -150)
296.
297. black_aankha()
298.
299.
300. if __name__ == '__main__':
301. screensize(800, 600, "#f0f0f0")
302. pensize(3)
303. speed(9)
304. Doraemon()
305. ankur(100, -300)
306. write('by Akhlak Ahmed', font=("Bradley Hand ITC", 30, "bold"))
307. mainloop()

You might also like