1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kamila [148]
3 years ago
14

What is the code for drawing a hexagon on python programming?

Computers and Technology
1 answer:
Alex Ar [27]3 years ago
4 0

Answer:

In this article, we will learn how to make a Hexagon using Turtle Graphics in Python. For that lets first know what is Turtle Graphics.

Turtle graphics

Turtle is a Python feature like a drawing board, which let us command a turtle to draw all over it! We can use many turtle functions which can move the turtle around. Turtle comes in the turtle library.The turtle module can be used in both object-oriented and procedure-oriented ways.

Some of the commonly used methods are:

forward(length): moves the pen in the forward direction by x unit.

backward(length): moves the pen in the backward direction by x unit.

right(angle): rotate the pen in the clockwise direction by an angle x.

left(angle): rotate the pen in the anticlockwise direction by an angle x.

penup(): stop drawing of the turtle pen.

pendown(): start drawing of the turtle pen.

Approach –

Define an instance for turtle.

For a hexagon execute a loop 6 times.

In every iteration move turtle 90 units forward and move it left 300 degrees.

This will make up Hexagon .

Below is the python implementation of above approach.

You might be interested in
What are QBASIC Operators ?​
Anna35 [415]

Answer: There are four types of operators in QBASIC. They are Arithmetic Operators, Relational Operators, Logical Operators and Sting Operator. a. Arithmetic Operators. Arithmetic Operators are used to perform mathematical calculations like addition, subtraction, division, multiplication and exponential. :)

5 0
4 years ago
Read 2 more answers
What information will you find in the 16-bit field in an IP datagram?
faust18 [17]

Answer: This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets.

Explanation: Hopefully this helps you with what ever u are doing.

7 0
3 years ago
How to do a row of circles on python , with the commands , picture is with it .
kotykmax [81]

Answer:

o.o

Explanation:

5 0
3 years ago
When installing a Windows 10 an already installed Windows 7 what happen​
astra-53 [7]

Answer:

are u updating it? or u r rooting it?

4 0
3 years ago
Read 2 more answers
Can you run microsoft office on a chromebook
zimovet [89]
Yes, you can Microsoft office in a Chromebook.
6 0
4 years ago
Other questions:
  • Define a function below called increase_elements_by_x, which takes two arguments - a list of numbers and a single positive numbe
    13·1 answer
  • A virus that propagates using the internet or another computer network is called __________.
    10·1 answer
  • What is the Java source filename extension? What is the Java bytecode filename extension?
    14·1 answer
  • In real-world environments, risks and their direct consequences will most likely span across several domains. However, in the la
    12·1 answer
  • The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons
    14·1 answer
  • Distinguish between exponentiation and modulus. Be specific.
    5·1 answer
  • What do you mean by real time system? Why real time system needs to response within limited time?
    6·1 answer
  • You have recently subscribed to an online data analytics magazine. You really enjoyed an article and want to share it in the dis
    9·1 answer
  • 2ND LAST QUESTION
    13·1 answer
  • What does the term attenuation mean in data communication?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!