Learn Python by yourself: draw interesting graphics with python

Using the program to draw, you can get very standard graphics, let's take a look at the picture effect below.

import turtle as t

import time

b=t.Pen()

for x in range(1,20):

b.forward(100)

b.right(170)

time.sleep(3)

After execution, you will get the following graph

image

Modify a few parameters to get the following picture

import turtle as t

import time

b=t.Pen()

for x in range(1,40):

b.forward(200)

b.right(95)

time.sleep(5)

image

Enter the code below to see the image below

import turtle as t

import time

b=t.Pen()

for x in range(1,500):

b.forward(x)

b.right(91)

time.sleep(5)

image

Execute this code, you can see the picture below, want to know how he draws it?

import turtle as t

import time

b=t.Pen()

for x in range(1,37):

b.forward(100)

b.left(90)

b.forward(100)

b.left(90)

b.forward(100)

b.left(90)

b.forward(100)

b.left(100)

time.sleep(5)

image

About turtle drawing, you need to know the following parameters:

image

——————————————
How to receive python welfare tutorial:
1. Like + comment (check "Retweet at the same time")
2. Follow the editor. And private message reply keyword [19]
(be sure to private message ~ click on my avatar to see the private message button)

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326874389&siteId=291194637