Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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() 
Comment

PREVIOUS NEXT
Code Example
Python :: how to find the medium, first, second and third quartile in a pandas data frame 
Python :: How to derive using sympy 
Python :: pdf to excel python 
Python :: currelation matrix python 
Python :: change orientatin of dict read pandas 
Python :: how to calculate chi square in python 
Python :: how to increase existing length with null python 
Python :: Print to the text file using inline file argument 
Python :: python filter function using lambda function as one of the parameters 
Python :: List Creating List 
Python :: list_display 
Python :: ssl expired python 
Python :: convert integer to binary python 
Python :: add months to date python 
Python :: port python script to jupyter notebook 
Python :: Get the positions of items of ser2 in ser1 as a list python 
Python :: python item defined in different definition stackoverflow 
Python :: online python debugger 
Python :: unpacking of tuples in python 
Python :: wget download file python magic 
Python :: python directed graph 
Python :: how to reverse a dictionary in python 
Python :: asyncio RuntimeError: Event loop is closed 
Python :: how to create a login page in python 
Python :: python loop invalid input 
Python :: pandas select only earliest event for duplicates 
Python :: box detection 
Python :: random ordered slice of an array 
Python :: python get_loc not returning number 
Python :: transpose 3d matrix pytorch 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =