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
SCORPION-xisa [38]
3 years ago
14

The loop function is similar to range(), but handles the parameters somewhat differently: it takes in 3 parameters: the starting

point, the stopping point, and the increment step. When the starting point is greater than the stopping point, it forces the steps to be negative. When, instead, the starting point is less than the stopping point, it forces the step to be positive. Also, if the step is 0, it changes to 1 or -1. The result is returned as a one-line, space-separated string of numbers.
Computers and Technology
1 answer:
nexus9112 [7]3 years ago
5 0

Answer and Explanation:

def loop(start, stop, step):

   return_string = ""

   if step == 0:

       step = 1

   if start > stop:  # the bug was here, fixed it

       step = abs(step) * -1

   else:

       step = abs(step)

   for count in range(start, stop, step):

       return_string += str(count) + " "

   return return_string.strip()

You might be interested in
You can insert a text box from the Insert tab or through the ______ tab in the Microsoft Publisher application.
jeka57 [31]
If i had to guess it would be 1. page design but i could be wrong i dont use publisher to much.
4 0
3 years ago
The layout of an envelope can be adjusted using the ____ tab
7nadin3 [17]
I think it’s the mailings tab
3 0
4 years ago
Can an apple watch break or have a camera?
Viktor [21]

Answer:

apple watches can break, and they can deffinetly have cameras if they engineered right.

Explanation:

5 0
3 years ago
Give at least three aftercare Activities you apply in cleaning airpot.<br>a.<br>b.<br>c.​
maria [59]

Answer: See explanation

Explanation:

An airpot is typically used in keeping of drinks warm. They can be used for outdoors or during meetings. Three aftercare activities that one can apply in cleaning airpot include:

a. To clean an airpot, use a damp cloth and soapy water after the remaining fluid that remains in the airpot has been emptied.

Ab. When cleaning an airpot, it should be noted that corrosive chemicals should not be used to clean them due to the fact that they aren't dishwasher safe.

c. Before storing the airpot, one needs to ensure that every part of the airpot gets dry.

5 0
3 years ago
Kali linux os and window os who is the best​
kogti [31]

Answer:

Windows

Explanation:

It is down to preference. I prefer windows due to its large compatibility with a wide range of apps.

4 0
3 years ago
Read 2 more answers
Other questions:
  • An example of software is
    9·2 answers
  • Is there anyone willing to sign into my google classroom account and help with my work :( i had surgery on monday and have about
    14·2 answers
  • What type of system security malware allows for access to a computer, program, or service without authorization?
    5·1 answer
  • What occurs when an application sends user-fed data directly to a web browser without authenticating or deleting the content? Cr
    15·1 answer
  • 52. Which of the following numbering system is used by the computer to display numbers? A. Binary B. Octal C. Decimal D. Hexadec
    12·2 answers
  • Which of the following is not a valid C language<br>int​
    6·1 answer
  • Write a complete method from the client perspective that duplicates each element in place in a ListInterface object. For example
    8·1 answer
  • Among the following protocols, terminology or considerations, indicate those that are associated with routing within a single ne
    5·2 answers
  • Pls answer this
    5·1 answer
  • Do you think should give credit to people who invented viral dances?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!