filmov
tv
Python – Draw Iron Man, Captain America Shield, Batman Logo in Python Turtle Library | Tutorial # 36

Показать описание
In this video I have explained how to make
1) Iron Man
2) Captain America Shield
3) Batman
in python using turtle library
Timestamps⏰
0:00 - Iron Man
5:05 - Captain America Shield
9:18 - Batman Logo
#python #programming #pythonturtle
---------------------------------------------------------------------
SOURCE CODE
1) IRON MAN:
import turtle
piece1=[[(-40, 120), (-70, 260), (-130, 230), (-170, 200),
(-170, 100), (-160, 40), (-170, 10), (-150, -10),
(-140, 10), (-40, -20), (0, -20)],
[(0, -20), (40, -20), (140, 10), (150, -10), (170, 10),
(160, 40), (170, 100), (170, 200), (130, 230), (70, 260),
(40, 120), (0, 120)]]
piece2=[[(-40, -30), (-50, -40), (-100, -46), (-130, -40), (-176, 0),
(-186, -30), (-186, -40), (-120, -170), (-110, -210),
(-80, -230), (-64, -210), (0, -210)],
[(0, -210), (64, -210),
(80, -230), (110, -210), (120, -170), (186, -40), (186, -30),
(176, 0), (130, -40), (100, -46), (50, -40), (40, -30), (0, -30)]]
piece3=[[(-60, -220), (-80, -240), (-110, -220), (-120, -250),(-90, -280),
(-60, -260), (-30, -260), (-20, -250), (0, -250)],
[(0, -250), (20, -250),
(30, -260), (60, -260), (90, -280), (120, -250),(110, -220), (80, -240),
(60, -220), (0, -220)]]
piece1goto = (0,120)
piece2goto = (0,-30)
piece3goto = (0,-220)
def draw_piece(piece,piecegoto):
for i in range(len(piece[0])):
x,y =piece[0][i]
for i in range(len(piece[1])):
x,y=piece[1][i]
draw_piece(piece1,piece1goto)
draw_piece(piece2,piece2goto)
draw_piece(piece3,piece3goto)
2) CAPTAIN AMERICA SHIELD:
import turtle
def circle(radius,color):
circle(300,'red')
circle(260,'white')
circle(220,'red')
circle(180,'blue')
for i in range(5):
3) BATMAN LOGO:
import turtle
bat = turtle.Turtle()
-----------------------------------------------------------------------------------------
After watching this video your following questions will be solved
1) How to make or draw ironman in python using library
2) How to make or draw captain america shield in python using turtle library
3) How to make or draw batman in python using turtle library
4) How to make or draw characters in turtle python
5) How to make marvel characters in python turtle module
6) How to make animations in python turtle
1) Iron Man
2) Captain America Shield
3) Batman
in python using turtle library
Timestamps⏰
0:00 - Iron Man
5:05 - Captain America Shield
9:18 - Batman Logo
#python #programming #pythonturtle
---------------------------------------------------------------------
SOURCE CODE
1) IRON MAN:
import turtle
piece1=[[(-40, 120), (-70, 260), (-130, 230), (-170, 200),
(-170, 100), (-160, 40), (-170, 10), (-150, -10),
(-140, 10), (-40, -20), (0, -20)],
[(0, -20), (40, -20), (140, 10), (150, -10), (170, 10),
(160, 40), (170, 100), (170, 200), (130, 230), (70, 260),
(40, 120), (0, 120)]]
piece2=[[(-40, -30), (-50, -40), (-100, -46), (-130, -40), (-176, 0),
(-186, -30), (-186, -40), (-120, -170), (-110, -210),
(-80, -230), (-64, -210), (0, -210)],
[(0, -210), (64, -210),
(80, -230), (110, -210), (120, -170), (186, -40), (186, -30),
(176, 0), (130, -40), (100, -46), (50, -40), (40, -30), (0, -30)]]
piece3=[[(-60, -220), (-80, -240), (-110, -220), (-120, -250),(-90, -280),
(-60, -260), (-30, -260), (-20, -250), (0, -250)],
[(0, -250), (20, -250),
(30, -260), (60, -260), (90, -280), (120, -250),(110, -220), (80, -240),
(60, -220), (0, -220)]]
piece1goto = (0,120)
piece2goto = (0,-30)
piece3goto = (0,-220)
def draw_piece(piece,piecegoto):
for i in range(len(piece[0])):
x,y =piece[0][i]
for i in range(len(piece[1])):
x,y=piece[1][i]
draw_piece(piece1,piece1goto)
draw_piece(piece2,piece2goto)
draw_piece(piece3,piece3goto)
2) CAPTAIN AMERICA SHIELD:
import turtle
def circle(radius,color):
circle(300,'red')
circle(260,'white')
circle(220,'red')
circle(180,'blue')
for i in range(5):
3) BATMAN LOGO:
import turtle
bat = turtle.Turtle()
-----------------------------------------------------------------------------------------
After watching this video your following questions will be solved
1) How to make or draw ironman in python using library
2) How to make or draw captain america shield in python using turtle library
3) How to make or draw batman in python using turtle library
4) How to make or draw characters in turtle python
5) How to make marvel characters in python turtle module
6) How to make animations in python turtle
Комментарии