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
Sonja [21]
1 year ago
10

Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two a

rguments, surrounded by brackets ([]) and separated by a comma and a space. Print an increasing sequence if the first argument is smaller than the second; otherwise, print a decreasing sequence. If the two numbers are the same, that number should be printed by itself.
Computers and Technology
1 answer:
a_sh-v [17]1 year ago
5 0

Answer:

def printRange(start, stop, steps = 1):

   list1 = []

   if steps > start or stop:

       print("Steps is larger than start and stop value")

       return None

   if int(start) < int(stop):

       while start < stop:

           start = start + int(steps)

           list1.append(start)

       print(list1)

   elif start > stop:

       while start > stop:

           stop = stop + int(steps)

           list1.append(stop)

       print(list1)

   elif start == stop:

       print(start)

   else:

       print("Values are not integers.")

for easier viewing:

https://www.codepile.net/pile/e95verLk

If you need help understanding comment below.

You might be interested in
HELP PLS TIME LIMIT HERE
Novosadov [1.4K]
I do it immediately, so it don’t effect my assignments or grades.
7 0
3 years ago
You open a folder by double-clicking on it with your mouse. True False
allsm [11]
Depends if it's not working the first time then u click it twice but normally you click it once
5 0
3 years ago
Read 2 more answers
Give two benifets to the supermarket maneger and two benifets of customers of using barcods on all items
sergey [27]

Answer:

The benefit of barcodes on items for the manager and the customers are as follow-

Explanation:

Benefits of using bar codes on all items to the manger are as follow -

  • The process of customer dealing increases by quickly scanning the item, rather than manually noting down the details.
  • The track record of all the items can be maintained properly.

Benefits of using bar codes on all items to the customers are as follow -

  • The time period to purchase any item increases, hence the customer can shop for many items in short span of time.
  • The chances of any mistake gets reduced, as everything is done digitally.
5 0
3 years ago
True or false windows 98 and windows xp are examples of an operating system?
rodikova [14]

Answer:

true

Explanation:

3 0
2 years ago
Describe two types of images you can open in photoshop
vredina [299]

Answer: PSD JPEG PNG

Explanation:

6 0
2 years ago
Other questions:
  • Sanjay is giving a slideshow presentation on his entire college class and he is feeling quite nervous in order to share his pres
    9·1 answer
  • I have all the points to level up to virtuoso, but it hasn't yet does anyone know when it will?
    9·1 answer
  • All tif files start at offset 0 with what 6 hexadecimal characters?​
    11·1 answer
  • What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
    7·2 answers
  • What is sun and what does it do?
    12·2 answers
  • What does the history feature in a web browser do
    10·1 answer
  • Biểu diễn cây sau bằng mảng một chiều
    12·1 answer
  • in a stop-and-wait arq system, the bandwidth of the line is 1 mbps, and 1 bit takes 10 ms to make a round trip. if the system da
    12·1 answer
  • Which type of computer is used microprocessor​
    5·1 answer
  • Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!