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
Adjusting the ______ adjusts the difference in appearance between light and dark areas of the photo.​
Svetach [21]

Answer:

contrast

Explanation:

4 0
3 years ago
Read 2 more answers
Chat messages are most likely to be found where on a computer? firewall nic internet history ram
miv72 [106K]
<span>The answer is RAM.  Chat messages are most likely to be found in the RAM of the computer.  It is Random Access Memory.  </span><span>RAM is considered volatile memory, which means that the stored information is lost when there is no more power.</span>
3 0
2 years ago
Consider the following language:
VMariaS [17]

L is a decidable language because the Turing machine accepts it.

L is a recognizable language if  TM M recognizes it.

<h3>How do you know if a language is decidable?</h3>

A language is said to be decidable only when there seems to exists a Turing machine that is said to accepts it,

Here, it tends to halts on all inputs, and then it answers "Yes" on words that is seen in the language and says "No" on words that are not found in the language. The same scenario applies to recognizable language.

So,  L is a decidable language because the Turing machine accepts it.

L is a recognizable language if  TM M recognizes it.

Learn more about programming language from

brainly.com/question/16936315

#SPJ1

8 0
1 year ago
A router is connected to a network 192.169.1.0/24 and network 192.168.2.0/24. The router is configured to use RIP and has learne
Mnenie [13.5K]

Answer:

Forward the packet to the next hop router specified by the route network 0.0.0.0

Explanation:

8 0
2 years ago
Peter is working on a project. He feels that the parameters need to be changed to meet the client specifications. First he must
11111nata11111 [884]

Answer:

C) chain

Explanation:

Small group network comprises of a vertical, direct, chain, all channel and box network

The vertical network is a network that is made for some specific purpose or goal of the business organization.

The direct network is a network that is directly interrelated to each other.

The chain network is that network in which the formal chain of command follows through which proper  communication can be done in all the departments without any barriers to a communication network

It also shows that each member can communicate the person below and above their position only in a vertical hierarchy. It follows the top-down approach

This all channel network follows an informal communication network through which anyone can communicate with anyone at any time with following any chain of the business organization

The box network covers all the things in one network. Like -  various software, packages, etc

In the given case Peter is asking permission from the supervisor and supervisor is discussing with the department director, is showing the formal chain of command that's why according to the given scenario the most appropriate answer is chain network.

8 0
3 years ago
Other questions:
  • In microsoft word, when you highlight existing text you want to replace, you’re in
    14·1 answer
  • What is the purpose of lookup tables in spreadsheet software
    13·2 answers
  • What is the recommended size for bulleted text?
    5·2 answers
  • ________ is a model of computing in computer processing, storage, software, and other services which are provided as a shared po
    9·1 answer
  • Enter a word: Good<br> Enter a word: morning<br> Good morning
    8·2 answers
  • What are some ways to find out what skills you need to develop at work? Check all of the boxes that apply.
    15·2 answers
  • Search engines enable you to
    12·1 answer
  • 2ND LAST QUESTION
    13·1 answer
  • Avi does not want to save his internet browsing details on his computer. What should he do?
    11·1 answer
  • When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!