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
nadya68 [22]
3 years ago
10

Write a function (named n_pointed_star) to make the turtle draw an n-pointed star. The function should return nothing, and accep

t a single parameter (n_points) which specifies the number of points to draw.
Computers and Technology
1 answer:
Andreyy893 years ago
8 0

Answer:

import sys

import turtle

import random

def n_pointed_star(total_points):

if total_points <= 4:

 raise ValueError('Not enough total_points')

area = 150

for coprime in range(total_points//2, 1, -1):

 if greatest_common_divisor(total_points, coprime) == 1:

  start = turtle.position()

  for _ in range(total_points):

   turtle.forward(area)

   turtle.left(360.0 / total_points * coprime)

  turtle.setposition(start)

  return

def greatest_common_divisor(a, b):

while b != 0:

 a, b = b, a % b

return a

   

turtle.reset()

n_pointed_star(5)

Explanation:

  • Inside the n_pointed_star function, check whether the total no. of points are less than or equal to 4 and then throw an exception.
  • Loop through the total_points variable and check whether the result  from greatest_common_divisor is equal to 1 or not and then set the starting position of turtle and move it.
  • Create the greatest_common_divisor which takes two parameters a and b to find the GCD.
  • Finally reset the turtle and call the n_pointed_star function.
You might be interested in
Concept of CPU scheduler?​
vekshin1

Answer:

CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold(in waiting state) due to unavailability of any resource like I/O etc, thereby making full use of CPU. ... The selection process is carried out by the short-term scheduler (or CPU scheduler).

6 0
3 years ago
AirPods se están despintando al ponerlos en quitaesmalte ayudaaaa?
slega [8]

Answer:

In reality, a diluted type of acetone that dissolves plastics and coating is Nail polish removers.

Explanation:

The chemical composition of the material has permanently changed, nothing else than if you had shot it. No repair but replacement is available.

Acetone does not get along with plastics.

This classic timelapse video shows just how cheap plastic acetone is.

When it's out, I have my new AirPods Pro. I got a odd smell when I opened the box when I received it. The little one is solid and chemical. It's new, I guess, and after days it will be gone.

But after ten days of use it doesn't. And the smell remains strong. It won't go quickly, I believe.

Instead I noticed that the smell is often shaping the silicone tips.

About 8 hours a day I use this AirPods Pro. Is it possible for a long time to use this smelling tip?

Actually, I must say they are soft and work well for noise cancelation, I love this silicone tip. If the strange smell doesn't hurt. To me, that's good.

6 0
3 years ago
Write down the functions of network layer in your own words.ASAP
sergeinik [125]
Hrhnebevevebnenebebenene
8 0
2 years ago
Prove the following assertion: For every game tree, the utility obtained by MAX using minimax decisions against a suboptimal MIN
TiliK225 [7]

Answer:

From the given diagram, consider a MIN node whose children are terminal nodes, if MIN plays  

suboptimal. MIN will never be lower than the utility obtained playing against an optimal MIN  

MIN will always select a move having minimax utility greater than or equal to the move that is  

predicted by the minimax that is the MIN-played optimal value.  

Then the MIN node's value is increased to MAX. This is done by induction.  

One can do better than the minimax strategy, if the suboptimal play is predicted by MIN.

If MIN always falls for certain for certain kind of trap and losses, then setting up a trap guarantees a win.

Explanation:

See attached picture also.

5 0
3 years ago
Dawn is trying to find out how much weight she can push across the room. She is really trying to find her __________. A. flexibi
Marrrta [24]

<em>The correct answer is d. muscular strength.</em>

<em></em>

<em>Explanation :</em>

<em></em>

<em>The maximal force a muscle can create when it contracts is referred to as muscular strength. When compared to someone with lower physical strength, someone with better muscular strength can lift heavier weights. Lifting progressively larger weights over time and eating a diet rich in protein-based foods can help a person's physical strength gradually grow.</em>

<em></em>

<em>I hope this helps. Please mark "Brainliest" if you can.</em>

8 0
2 years ago
Other questions:
  • Food is shipped thousands of miles throughout our country using various types of transportation such as trucks, planes, and boat
    10·1 answer
  • ________ is digital textual information that can be stored, manipulated, and transmitted by electronic devices.
    7·1 answer
  • Need help with this
    13·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • What is the web of trust
    7·2 answers
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • Pride Group of Companies is making tremendous profits in different categories of electronic goods. The group of managers have to
    12·1 answer
  • ¡Hola! He visto en muchos comentarios de Twitter "svd" cuando alguien dice "dale fav a este Tweet y siganse entre ustedes" y en
    8·1 answer
  • How many 2/8 pound patties can she make from 7/8 of a pound of hamburger
    10·1 answer
  • Which option should Gina click to edit the text contained in a text box on a slide in her presentation?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!