K
K
KomEvg2020-08-02 10:04:26
Python
KomEvg, 2020-08-02 10:04:26

You need to enter a number, and the turtle make a polygon with the number of corners equal to the given number?

I just started learning python, do not judge strictly, I don’t know much =(

import turtle
f=turtle.Turtle()
g=int(input())
w=360/g
for i in range (g):
  f.forward(30)
  f.left(w)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-08-02
@dimonchik2013

normas

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question