@DragoniteDL/

polygon drawer with colors

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
import turtle as t


t.clear()
t.penup()
t.goto(0,0)
var1 = 360
user_sides = int(input('Sides: '))
user_outline = str(input('Outline: '))
user_inline = str(input('Fill: '))
user_size = int(input('Size: '))

t.color(user_outline,user_inline)
t.begin_fill()
while (var1 != 0):
  t.pendown()
  t.forward(user_size)
  t.right(360 / user_sides)
  var1 = var1 - 360 / user_sides
t.end_fill()
print('')
print('Finished!')
result
console