Cartoon Character Project
Cartoon Character Project
1
C ONTENT
1) Introduction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (4-5)
6) output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(29-33)
This python project is to define the how we can write a code in python
programming language.
The python programming language is easy to other language so you can easily
write a code in python language.
In this python language we create a cartoon character with the help of python
code.
In this project we all are students to claim our project is most attractive way to
understand the project.
We all are must select the theme because this project is showing to creativity
and attractivity.
Many peoples can inspired of our project. In this theme we use a simple source
code to make a project.
We all are highlighting a problem why we use this project because currently we
learnt a python language and we will not brief information about python
language.so that’s why we create a simple project but after some time we will
learn a whole information about python programming language and we will
create a major project.
It also allows the project is diferent from many other project because it shows to
creativity and attractivity.
1
In these introductive parts we are adding an image or picture of output of our
program. In this given below.
This is the output of our project & it’s creativity and attractive project.
2
2. Objective and scope of the project
Definition
Scope: The totality of outputs, outcomes and benefits and the work required to produce
them.
Objectives: Predetermined results towards which effort is directed. Objectives may be defined
in terms of outputs, outcomes and/or benefits.
General
Scope comprises the totality of the outputs, outcomes and benefits and the work required to
produce them. It is the scope of work that is the deciding factor as to whether it will be
managed as a project, programme or portfolio.
The way in which scope is managed depends upon two things; the nature of the objectives
(outputs, benefits or strategic) and the definability of the objectives.
The scope of a project will typically include outputs, but may be extended to cover benefits.
Objectives
Students will be able to know how to draw a simple cartoon character well. Almost
everyone watched cartoons in their childhood. Learning how to draw some basic rules
to draw simple cartoon character is sometimes really useful. For instance, you could
draw some simple cartoon characters on a poster. Cartoon characters could attract
people's eyes. I will try to teach how to make a character looks cute :)
Show students some simple cartoon characters and give them a general idea about how
simple cartoon characters looks like. Attract their eyes.
3
3. System implementation
Device name : - HP
4
4.Theoretical knowledge
Its high-level built in data structures, combined with dynamic typing and dynamic binding,
make it very attractive for Rapid Application Development, as well as for use as a
scripting or glue language to connect existing components together. Python's simple,
easy to learn syntax emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which encourages program
modularity and code reuse. The Python interpreter and the extensive standard library are
available in source or binary form without charge for all major platforms, and can be freely
distributed.
❖ Features of python
Installing python
5
Interacting with python:
• Using idle.
6
4.2 What is python turtle ?
Turtle is a Python library which used to create graphics, pictures, and games. It was
developed by Wally Feurzeig, Seymour Parapet and Cynthina Slolomon in 1967. It
was a part of the original Logo programming language.
The Logo programming language was popular among the kids because it enables us to
draw attractive graphs to the screen in the simple way. It is like a little object on the
screen, which can move according to the desired position. Similarly, turtle library comes
with the interactive feature that gives the flexibility to work with Python.
In this tutorial, we will learn the basic concepts of the turtle library, how to set the turtle
up on a computer, programming with the Python turtle library, few important turtle
commands, and develop a short but attractive design using the Python turtle library.
Introduction
Turtle is a pre-installed library in Python that is similar to the virtual canvas that we can draw
pictures and attractive shapes. It provides the onscreen pen that we can use for drawing.
The turtle Library is primarily designed to introduce children to the world of programming.
With the help of Turtle's library, new programmers can get an idea of how we can do
programming with Python in a fun and interactive way.
It is beneficial to the children and for the experienced programmer because it allows
designing unique shapes, attractive pictures, and various games. We can also design the
mini games and animation. In the upcoming section, we will learn to various functionality of
turtle library.
7
o Python Version - We must have Python 3 in our system; if not, then download
it from Python's official website.
The turtle is built in library so we don't need to install separately. We just need to import the
library into our Python environment.
The Python turtle library consists of all important methods and functions that we will need to
create our designs and images. Import the turtle library using the following command.
1. import turtle
Now, we can access all methods and functions. First, we need to create a dedicated window
where we carry out each drawing command. We can do it by initializing a variable for it.
1. s = turtle.getscreen()
It will look like an above image and the little triangle in the middle of the screen is a turtle. If
the screen is not appearing in your computer system, use the below code.
1. Example -
1. import turtle
2. # Creating turtle screen
3. s = turtle.getscreen()
4. # To stop the screen to display
5. turtle.mainloop()
8
Output:
The screen same as the canvas and turtle acts like a pen. You can move the turtle to design
the desired shape. The turtle has certain changeable features such as color, speed, and size.
It can be moved to a specific direction, and move in that direction unless we tell it otherwise.
In the next section, we will learn to program with the Python turtle library.
o Forward
o Backward
o Left
o Right
9
1.2.1Turtle motion
The turtle can move forward and backward in direction that it's facing. Let's see the following
functions.
Example - 1:
1. import turtle
2. # Creating turtle screen
3. t = turtle.Turtle()
4. # To stop the screen to display
5. t.forward(100)
6. turtle.mainloop()
Output:
10
5. Project explanation
1. About project
In this project, we will be learning to draw the famous cartoon character Shinchan with
Python Turtle.
By the end of this tutorial, you will have cleared your concept regarding the basics of
python, the basics of the turtle module, and the intermediate of the turtle module. First,
we will see how to code our cartoon and see the code itself.
1. Explanation : -
First Part : -
• First, import everything from the turtle module. Then, set a turtle screen into a
variable “s”. Set the screen size to (700, 1000) and the speed to 5.
• Define a function myPosition() with the parameters “x, y”. Here, pick the pen up as
we are not ready to draw. Go to the position as in (x, y). Put the pen down. Set the
pen size to 2.
Second Part : -
• Define a function named Aakash () for the shorts of our drawing. Here, set the fill
color as ‘#ffec40’. Begin the fill. Now, move the turtle right at 25 units, forward at 20,
right at 45, and again forward at 20 units. Move the turtle left at a value of 70 units
and again forward at 90 units. Likewise, move the turtle left at 95 units, forward at
90, left at 95, forward at 75, left 85, and again forward at 175 units. Similarly, move it
left at 85 units, forward at 75, and as in the code. End the fill.
• Define another function named leftLeg(). Here, set the position to (-39, -25). Set the
fill color as ‘#ffd699’. Begin the fill. Move the turtle right at 89 degrees, forward at 25,
right at 90, and forward at 50. Likewise, move the turtle right at 90 units, forward at
20, right at 85, and again forward at 50 units. End the fill.
11
• Define other functions for different body parts and. You can see that the most used
functions and methods are forward, left, right, begin_fill(), fillcolor(), and endfill().
• Going on with defining and implying all the function, now, create another one named
allLegs(). Inside this function, call all the functions that are associated with drawing
the parts of the legs of the cartoon. The functions are : leftLeg(), leftSock(),
leftShoe(), rightLeg(), rightSock(), rightShoe().
• Likewise, create a function named allHands that assembles the parts of the hands of
the cartoon. The functions are: rightHand(), leftHand(), myBis() and leftHand2().
• Similarly, create another function named allEyebrows(). Here, call the myEyebrow()
function with the arguments (-8, 300), right at 90 units, again myEyebrow with the
arguments (72, 300), myEyelid() with the arguments (-8, 270), left with 15 units, and
at last myEyelid() with (68, 265).
Last Part : -
• Here, call all the functions that were assembled in the above part. Here call the
function: ankur(), allLegs()myShirt(), myHead() ,allHands(), myMouth(),
allEyebrows(), allEyes(), myRobot().
• After it is done, hide the turtle with the method ht() and finish the code with the
done() method.
12
Coding
13
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 Aakash():
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.
34.
def leftLeg():
35.
myPosition(-39,-25)
36.
fillcolor("#ffd699")
37.
begin_fill()
38.
39. right(89)
40. forward(25)
41. right(90)
42. forward(50)
43. right(90)
44. forward(20)
45. right(85)
46. forward(50)
47. end_fill()
48.
49. def leftSock():
myPosition(-36,-78)
14
50. fillcolor("#ffffff")
51. begin_fill()
52. right(90)
53. circle(80,13)
54. right(110)
55. forward(22)
56. right(85)
57. forward(19)
58. right(90)
59. forward(21)
60. end_fill()
61.
62. def leftShoe():
63. myPosition(-69,-112)
64. fillcolor("#b5ae60")
65. begin_fill()
66. right(90)
67. left(5)
68. forward(56)
69. left(105)
70. forward(13)
71. left(75)
72. forward(20)
73. right(90)
74. forward(15)
75. circle(10,15)
76. left(80)
77. forward(4)
78. circle(10,15)
79. left(40)
80. circle(20,15)
81. forward(10)
82. right(45)
83. forward(15)
84. circle(25,25)
85. end_fill()
86.
87. def rightLeg():
88. myPosition(60,-28)
89. fillcolor("#ffd699")
90. begin_fill()
91. #right(90)
92. left(128)
93. forward(25)
94. right(95)
95. forward(55)
96. right(90)
97. forward(20)
98. right(85)
15
99. forward(55)
100. end_fill()
101.
102. def rightSock():
103. myPosition(64,-79)
104. fillcolor("#ffffff")
105. begin_fill()
106. right(90)
107. circle(90,14)
108. right(110)
109. forward(23)
110. right(90)
111. forward(15)
112. right(80)
113. forward(21)
114. end_fill()
115.
116. def rightShoe():
117. myPosition(64,-108)
118. fillcolor("#b5ae60")
119. begin_fill()
120. right(100)
121. forward(56)
122. left(160)
123. forward(25)
124. right(68)
125. forward(17)
126. left(90)
127. circle(18,15)
128. forward(5)
129. left(75)
130. forward(11)
131. right(85)
132. forward(20)
133. left(45)
134. circle(10,30)
135. left(25)
136. forward(5)
137. end_fill()
138.
139. def myShirt():
140. myPosition(-75,48)
141. fillcolor("red")
142. begin_fill()
143. left(72)
144. forward(185)
145. left(87)
146. forward(75)
147. right(68)
16
148. circle(20,8)
149. circle(300,23)
150. left(90)
151. circle(35,17)
152. right(38)
153. circle(35,17)
154. left(58)
155. forward(75)
156. right(12)
157. forward(140)
158. right(40)
159. forward(93)
160. left(120)
161. circle(-20,65)
162. left(75)
163. forward(10)
164. left(23)
165. forward(88)
166. #circle(-80,10)
167. right(31)
168. forward(87)
169. right(180)
170. forward(108)
171. right(180)
172. forward(104)
173. circle(10,70)
174. end_fill()
175.
176. def myHead():
177. myPosition(-20,295)
178. left(20)
179. pensize(2)
180. fillcolor('#fcc6a0')
181. begin_fill()
182. right(90)
183. forward(40)
184. right(90)
185. circle(50,80)
186. left(10)
187. circle(50,80)
188. left(2)
189. circle(200,50)
190.
191. left(48)
192. forward(60)
193. #left(20)
194. circle(45,60)
195. right(5)
196. circle(100,85)
17
197. end_fill()
198. fillcolor('black')
199. begin_fill()
200.
201. pensize(2)
202. right(170)
203. circle(-100,165)
204. right(78)
205. forward(26)
206. right(87)
207. forward(55)
208. circle(45,60)
209. right(5)
210. circle(100,85)
211. end_fill()
212.
213. fillcolor('#fcc6a0')
214. begin_fill()
215. right(180)
216. circle(-100,105)
217. right(37)
218. forward(49)
219. pensize(2)
220. left(130)
221. forward(30)
222. #right(5)
223. circle(-10,70)
224. right(50)
225. #circle(10,10)
226. forward(36)
227. right(80)
228. forward(50)
229. pencolor('#fcc6a0')
230. right(90)
231. forward(30)
232.
233. end_fill()
234.
235. def rightHand():
236. #left(35)
237. myPosition(197,209)
238. pencolor('black')
239. fillcolor('#fcc6a0')
240. begin_fill()
241. right(45)
242. forward(6)
243. left(55)
244. forward(20)
245. circle(-5,70)
18
246. right(100)
247. forward(18)
248. left(105)
249. forward(18)
250. circle(-5,70)
251. right(100)
252. forward(18)
253. left(145)
254. forward(15)
255. circle(-5,70)
256. right(100)
257. forward(18)
258.
259. left(150)
260. forward(13)
261. circle(-5,70)
262. right(100)
263. forward(15)
264.
265. left(150)
266. forward(10)
267. circle(-5,70)
268. right(100)
269. forward(12)
270. circle(60,10)
271. left(45)
272. forward(6)
273. right(90)
274. forward(10)
275. end_fill()
276.
277. def leftHand():
278. myPosition(-94,242)
279. fillcolor('#fcc6a0')
280. begin_fill()
281. right(10)
282. forward(6)
283. left(90)
284. penup()
285. forward(12)
286. pendown()
287. left(90)
288. forward(8)
289. left(90)
290. forward(12)
291. end_fill()
292.
293. def myBis():
294. myPosition(-103,291)
19
295. right(90)
296. fillcolor('#02d302')
297. begin_fill()
298. right(90)
299. forward(55)
300. left(80)
301. forward(12)
302. left(10)
303. forward(17)
304. left(10)
305. forward(12)
306. left(80)
307. forward(55)
308. left(80)
309. forward(12)
310. left(10)
311. forward(17)
312. left(10)
313. forward(12)
314. left(80)
315. left(80)
316. forward(12)
317. left(10)
318. forward(17)
319. left(10)
320. forward(12)
321. end_fill()
322. penup()
323. right(100)
324. forward(20)
325. right(90)
326. forward(14)
327. pendown()
328. pencolor('#9c5e4a')
329. fillcolor('#9c5e4a')
330. begin_fill()
331. for i in range(5):
332. forward(15)
333. right(144)
334. end_fill()
335. penup()
336. forward(27)
337. left(90)
338. forward(16)
339. left(90)
340. forward(7)
341. pendown()
342. fillcolor('#9c5e4a')
343. begin_fill()
20
344. for i in range(5):
345. forward(10)
346. right(144)
347. end_fill()
348. penup()
349. forward(20)
350. right(90)
351. forward(5)
352. pendown()
353. fillcolor('#9c5e4a')
354. begin_fill()
355. for i in range(5):
356. forward(10)
357. right(144)
358. end_fill()
359. penup()
360. right(180)
361. forward(6)
362. pendown()
363. fillcolor('#9c5e4a')
364. begin_fill()
365. for i in range(5):
366. forward(10)
367. right(144)
368. end_fill()
369.
370. def leftHand2():
371. myPosition(-112,284)
372. pencolor('black')
373. fillcolor('#fcc6a0')
374. begin_fill()
375. right(180)
376. forward(31)
377. left(90)
378. for i in range(2):
379. circle(4,90)
380. #circle(4//2,45)
381. for i in range(3):
382. right(180)
383. for i in range(2):
384. circle(4,90)
385. end_fill()
386.
387. def myMouth():
388. myPosition(-25,200)
389. left(65)
390. fillcolor('#77332e')
391. begin_fill()
392. #circle(20)
21
393. #forward(20)
394. for i in range(2):
395. circle(25,90)
396. circle(25//2,90)
397. end_fill()
398.
399. def myEyebrow(x,y):
400. myPosition(x,y)
401. pensize(18)
402. right(150)
403. forward(25)
404. right(90)
405. for i in range(1):
406. right(45)
407. dot(15)
408. left(55)
409. forward(25)
410. for i in range(1):
411. right(45)
412. dot(15)
413.
414. def myEyelid(x,y):
415. myPosition(x,y)
416. pensize(2)
417. left(170)
418. circle(-23,180)
419.
420. def myallEyes1(x,y):
421. myPosition(x,y)
422. right(90)
423. fillcolor('#000000')
424. begin_fill()
425. circle(18)
426. end_fill()
427. left(90)
428. penup()
429. forward(19)
430. right(90)
431. forward(7)
432. pendown()
433. fillcolor('#ffffff')
434. begin_fill()
435. left(90)
436. circle(9)
437. end_fill()
438.
439. def myallEyes2(x,y):
440. myPosition(x,y)
441. right(90)
22
442. fillcolor('#000000')
443. begin_fill()
444. circle(18)
445. end_fill()
446. left(90)
447. penup()
448. forward(19)
449. right(90)
450. forward(8)
451. pendown()
452. fillcolor('#ffffff')
453. begin_fill()
454. left(90)
455. circle(9)
456. end_fill()
457.
458. def myRobot():
459. myPosition(155,-105)
460. left(93)
461. color('red')
462. pensize(7)
463.
464. begin_fill()
465. forward(50)
466. left(90)
467. forward(50)
468. left(90)
469. forward(50)
470. left(90)
471. forward(50)
472. left(90)
473. end_fill()
474.
475. color('white')
476. penup()
477. left(90)
478. forward(30)
479. right(90)
480. forward(12)
481. pendown()
482. pensize(3)
483. circle(5)
484. penup()
485. forward(25)
486. pendown()
487. circle(5)
488.
489. penup()
490. right(90)
23
491. forward(20)
492. right(90)
493. pendown()
494.
495. begin_fill()
496. forward(23)
497. right(90)
498. forward(7)
499. right(90)
500. forward(23)
501. right(90)
502. forward(7)
503. right(90)
504. end_fill()
505.
506. penup()
507. forward(25)
508. right(90)
509. forward(35)
510. pendown()
511.
512. color('red')
513. forward(30)
514. penup()
515. right(90)
516. pendown()
517. begin_fill()
518. circle(5)
519. end_fill()
520.
521. def allLegs():
522. leftLeg()
523. leftSock()
524. leftShoe()
525. rightLeg()
526. rightSock()
527. rightShoe()
528. def allHands():
529. rightHand()
530. leftHand()
531. myBis()
532. leftHand2()
533. def allEyebrows():
534. myEyebrow(-8,300)
535. right(90)
536. myEyebrow(72,300)
537. myEyelid(-9,270)
538. left(15)
539. myEyelid(68,265)
24
540. def allEyes():
541. myallEyes1(17,275)
542. myallEyes2(95,270)
543. Aakash()
544. allLegs()
545. myShirt()
546. myHead()
547. allHands()
548. myMouth()
549. allEyebrows()
550. allEyes()
551. myRobot()
552. ht()
553. done()
Note: The above program was coded on Python 2 version. So, if you find your
code editor directing an error, do not worry, it will run fine.
25
output
26
First part.
Second part.
Third part.
27
Fourth part.
Fifth part.
Sixth part.
28
Seventh part.
Eight part.
Ninth part.
29
Tenth part.
30
6. User manual
Hardware requirement –
• `Intel i5 processor based at client / server end.
• 8 gb RAM and 30 mb required for project.
• Standard I/ O devices like keyboard & mouse etc.
• Printer is needed for hard copy reports.
• Local area network (LAN) is required for server installation.
Software requirement -
• MS word version 2019 is needed for project documentation.
• Visual studio code tool kit is required for coding.
• & you can also download or install it can be using this website.
https://pythonturtle.org/.
• you want to more information about python turtle just copy on this link and
search on your browser Python Turtle Programming Tutorial - java point.
Note : - The PC must have install python software to write & run the code.
31
7. References / Bibliography
3. https://www.python.org/downloads/
4. https://pythonturtle.org/.
32