Horje
Drawing diff circles with random radius in diff positions . Code Example
Drawing diff circles with random radius in diff positions .
# Play with turtle and random modules
import turtle
import random


sc = turtle.Screen()
t = turtle.Turtle()
sc.setup(800,600)
sc.title("setup")
t.pensize(3)
t.speed(0)

#  Drawing diff circles with random radius in diff positions , Range(-200,200)

for n in range(100):
      color = ["red", "green", "blue", "purple", "yellow", "orange", "black"]
      t.pencolor(random.choice(color))
      t.penup()
      t.goto(random.randint(-200,200), random.randint(-200,200))
      t.pendown()
      t.circle(random.randint(0,20))


sc.exitonclick() 




Python

Related
changing instance variable python inheritance Code Example changing instance variable python inheritance Code Example
python 3 define type in arguments with default value Code Example python 3 define type in arguments with default value Code Example
how to get device hwid cmd Code Example how to get device hwid cmd Code Example
change between two python 3 version in raspberrry pi Code Example change between two python 3 version in raspberrry pi Code Example
57 *2 Code Example 57 *2 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8