In: Computer Science
Q8) Draw a twelve-pointed star. code and run from PYCHARM.
Q9) Write a program that prompts the user to enter the radius of the rings and draws an Olympic symbol of five rings of the same size with the colors blue, black, red, yellow, and green. code and run from PYCHARM.
8)
source code:
import turtle
top=turtle.Turtle()
for i in range(12):
theta=180.0-180.0/12
top.forward(60)
top.right(theta)
top.forward(60)
input("")
#Output:
9)source code:
import turtle
def olympic_Sysmbol(radius):
top =turtle.Turtle()
top.pensize(3)
color1= ["blue", "black", "red"]
radius=100
for i in range(3):
top.penup()
top.pencolor(color1[i])
top.goto(i*110, 0)
top.pendown()
top.circle(radius)
color2= ["","yellow", "","green"]
for i in range(1,4,2):
top.penup()
top.pencolor(color2[i])
top.goto(i*55, -50)
top.pendown()
top.circle(radius)
input("")
a=int(input("Enter Radius of the circle"))
olympic_Sysmbol(a)
#output:
#if you have any doubts comment below...