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
Format character of Date function that display the day of the month in 2 digits with leading zeros such as 01 to 31
JulsSmile [24]

Answer:

b.d

Explanation:

The format of the outputted string format totally depends upon the string format character according to the question the answer is format charatcer d.

It represents the day of the months in 2 digits in numerical format with leading zeroes.

L represents whether the year is a leap year or not.

D represents the days of the month in textual format with three characters like Sun for sunday.

j It represents the days of the month without leading zeroes.

5 0
3 years ago
Open punctuation means that no punctuation follows the salutation or complimentary close. *
zloy xaker [14]

Answer:

True

Explanation:

When open punctuation is used, we do not expect the use of punctuation after salutation or complimentary close. It is a relatively new concept in business writing and we can rightly use this method in modified block letter style of writing.  

Some companies have developed business letter templates that are arranged in an open style, which permits the use of open punctuation in all aspect of business writings.  

7 0
3 years ago
Which of the following statements is correct? A. The columns will be listed in the results in the same order they are stored in
Mrac [35]

Hello! The answer to your question would be as followed:

C. The columns will be listed in the results in the same order they are listed in the SELECT clause of the SELECT statement.

5 0
3 years ago
After a hard rain, water flows faster in a local creek. This washes away a lot of sediment, making the creek a little deeper.
notka56 [123]
B. The Grand Canyon 
Got this of a Study Island test.  Good Luck!
6 0
3 years ago
2. You can ___ adjust to NOT sleeping at night.
zhannawk [14.2K]

Answer:

whats the answer chooses

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following statements is false?
    10·1 answer
  • In order to prevent unauthorized access, how can the shadow file be configured to enforce a password policy?​ What happens to ac
    6·1 answer
  • Why should spain go to Africa ​
    15·1 answer
  • It's inventiveness uncertainty and futuristic ideas typically deals with science and technology ......what is it.
    8·1 answer
  • Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =
    7·2 answers
  • How do you work with collaborators like copywriters developers and project managers?
    11·1 answer
  • A short cut to save a file is
    15·1 answer
  • Consider the following code snippet:
    13·1 answer
  • Tabs are usually set ________ to the right of the left margin.
    10·2 answers
  • write a function named get majority last name that accepts as its parameter a dictionary from strings to strings the keys of the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!