[Python] [29] [demo experimental practice examples drawn pentagram] [use] turtle

Original title:

Use five-pointed star painted turtle:

My code:

# ! / Usr / bin / Python 
# encoding = UTF. 8- 
# - * - Coding: UTF-. 8 - * - 


from Turtle Import Turtle 

P = Turtle ()             #     
p.speed (. 3)                 # brush speed 
p.pensize (5 )             # brush thickness 
p.color ( " Black " , ' Yellow ' )     # brush color / background color 
# p.fillcolor ( "Red") # Beijing color 





p.begin_fill () 
for i in the Range (5 ): 
     p.forward ( 200)   #The arrows to move a specified coordinate 
     p.right (144)     # current rotational direction of the right angle 
p.end_fill ()

 

 

Change the angle, you can draw other graphics

My code:

# ! / Usr / bin / Python 
# encoding = UTF. 8- 
# - * - Coding: UTF-. 8 - * - 


from Turtle Import Turtle 

P = Turtle ()             #     
p.speed (300)                 # brush speed 
p.pensize (1 )             # brush thickness 
p.color ( " Black " , ' Yellow ' )     # pen color / color Beijing 
# p.fillcolor ( "Red") # overall Beijing color     


p.begin_fill ()                 
for i in the Range (360 ): 
     the p-. Forward ( 500)  # Arrow to move a specified coordinate 
     p.right (177)     # current rotational direction of the right angle 
p.end_fill ()

 

 

Renderings:

 

 

 

 

 


-------- (I am dividing line) --------

reference:

1. None

 

Remarks:

Initial modified: October 4, 2019 15:45:54

Environment: Windows 7 / Python 3.7.2

Guess you like

Origin www.cnblogs.com/kaixin2018/p/11622445.html