repl.it
@janimanthan80/

square with circle

Python (with Turtle)

No description

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import turtle
import random

t = turtle.Turtle()
t.speed(250)

def my_function(length, angle):
    t.begin_fill()
    t.fillcolor("black")
    t.forward(length)
   
    t.right(angle)
   
    
    t.forward(length)
    t.end_fill()
    t.right(angle)
    
    t.begin_fill()
    t.fillcolor("blue")
    t.forward(length)
    
    t.right(angle)
  
    t.forward(length)
    
    t.right(angle)
    t.end_fill()
for i in range(54):   
    my_function(75,90)  
    t.right(16)
    
    t.right(18)

  
result
console