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
Which types of computers are used by large businesses
aniked [119]

answer:

Mainframe computers are used by large companies and organisations to perform critical tasks that involve bulk data processing like transaction processing, census information, statistical data and so on. They consist of extensive input and output facilities, are very stable and dependable and handle millions of transactions every day

Explanation:

4 0
3 years ago
Write pseudo code that performs the following: Ask a user to enter a number. If the
CaHeK987 [17]
Answer:
BEGIN
INPUT N
IF N>0 AND N<10 THEN
OUTPUT "blue"
ELSE
IF N>10 AND N<20 THEN
OUTPUT "red"
ELSE
IF N>20 AND N<30 THEN
OUTPUT "green"
ELSE
OUTPUT "It is not a correct color option"
ENDIF
END.

Explanation:

3 0
2 years ago
The development methodology where each part of a project is done in order after each other is called:
Oksanka [162]

Bruh this a duplicate

8 0
3 years ago
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
Understanding photo album dialog box options
FrozenT [24]
Where are the options and the dialog
8 0
3 years ago
Other questions:
  • I'm curious why I would need to know this on a school learning site.
    12·1 answer
  • A process that allows software-based networked computers to run multiple operating systems and programs and share storage is cal
    5·1 answer
  • Windows server 2008 supports three versions of certificate templates. what version or versions of templates can be issued only f
    13·1 answer
  • What is the term for a calculation (using encryption technologies) based on the contents of a disk or file that are engineered s
    8·1 answer
  • Assume n represents the number of inputs. The possible number of states within a truth table can be calculated using which of th
    10·1 answer
  • Which model allows you to make subsystems in parallel?
    12·1 answer
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • Powerful IT security systems are needed to defend against what appears to be authorized access to a network or application. Sele
    6·1 answer
  • Fill in the word to complete the sentence.
    10·1 answer
  • Write a program that removes all non-alphabetic characters from the given input.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!