One of the current variants of the power on/off symbols. incorporating both the I and O. The Python Turtle algorithm here utilizes color filled circles and rectangles to hide portions not needed for the final image.
Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)
Incidentally, for more graphics and variations, please visit my author url at https://www.amazon.com/author/basicpy...
import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(10) #Changeable
r = 240 #Changeable; Size of graphic; Radius of biggest circle
l = 0.5 * r #Initial length to be used for color-filled rectangle
w = 0.3 * r #Initial width to be used for color-filled rectangle
def circle(r): #Procedure for drawing a color-filled circle with radius r
t.begin_fill()
t.circle(-r) #Circle generated clockwise
t.end_fill()
def rectangle(l, w): #Procedure for drawing a color-filled rectangle with length l and width w
t.backward(l / 2) #Tactical step to have a simple "for" loop
t.begin_fill()
for i in range(2): #Loop to draw lines l and w two times to form a rectangle
t.forward(l)
t.right(90)
t.forward(w)
t.right(90)
t.end_fill()
for color in ("black", "white", "black"): #Python_Graphic start of drawing procedure
t.color(color) #Assignment of "black" as pen and fill color, as "for" loop starts
t.penup()
t.goto(0, r) #Trail-less movement of turtle to starting point of circle drawing
t.pendown()
circle(r) #Function call to draw a color-filled circle with radius r
r = 0.8 * r #Change in r value for the next color-filled circle
for color in ("black", "white"): #Loop to draw two unequally sized rectangles for the bar in Power Symbol
t.color(color) #Assignment of "black" as pen and fill color, as "for" loop starts
t.penup()
t.goto(0, 1.7 * r) #Trail-less movement of turtle to starting point of rectangle drawing
t.pendown()
rectangle(l, w) #Function call to draw a color-filled rectangle with current l and w
l = 0.25 * r #Change in l value for the next color-filled rectangle
w = 1.5 * r #Change in w value for the next color-filled rectangle
t.hideturtle()
screen.exitonclick()