python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
# import turtle package import turtle,time #creating a turtle screen object sc=turtle.Screen() #creating a turtle object(pen) pen=turtle.Turtle() #defining a method to form a semi circle #with a dynamic radius and colour def semi_circle(col,rad,val): #set the fill colour of the semicircle pen.colour(col) #draw a circle pen.circle(rad,-180) #move the turtle to air pen.up() #move the turtle to a given position pen.setpos(val,0) #move the turtle to the ground pen.down pen.right(180) #set the colours for drawing col=["violet","indigo","blue","green","yellow","orange","red"] #setup the screen features sc.setup(800,600) #set the screen colour to black sc.bgcolour('black') #setup the turtle features pen.right(90) pen.width(10) pen.speed(7) #loop to draw 7 semi circles for i in range(7): semi_circle(col[i],10*(i+8),-10*(1+1))
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up