scientific-programming-exer.../ex_06.py

21 lines
283 B
Python
Raw Permalink Normal View History

2018-10-31 12:48:30 +00:00
#!/usr/bin/python3
import turtle
# The sum of the inner angles of a polygon
# in an euclidian plane:
2018-10-31 14:53:43 +00:00
n = 7
2018-10-31 12:48:30 +00:00
inner_angle_sum = (n - 2) * 180
# Distance between two vertices
l = 70
for i in range(n):
turtle.forward(l)
turtle.right(180 - inner_angle_sum / n)
turtle.mainloop()