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
Fynjy0 [20]
3 years ago
11

Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt

ional arguments, but should return a list.
Do not use the range function in your implementation!

Hints:

Study Python’s help on range to determine the names, positions, and what to do with your function’s parameters.
Use a default value of None for the two optional parameters. If these parameters both equal None, then the function has been called with just the stop value. If just the third parameter equals None, then the function has been called with a start value as well. Thus, the first part of the function’s code establishes what the values of the parameters are or should be. The rest of the code uses those values to build a list by counting up or down.
Computers and Technology
2 answers:
Cerrena [4.2K]3 years ago
6 0

Answer:

Study Python’s help on range to determine the names, positions, and what to do with your function’s parameters.

Use a default value of None for the two optional parameters. If these parameters both equal None, then the function has been called with just the stop value. If just the third parameter equals None, then the function has been called with a start value as well. Thus, the first part of the function’s code establishes what the values of the parameters are or should be. The rest of the code uses those values to build a list by counting up or down.

Natasha_Volkova [10]3 years ago
3 0

Answer:

#section 1

def ran(first, *last):

  li = []

#section 2

  try:

      if len(last) > 2:

          raise ValueError

      

      elif len(last) == 1:

          while last[0] > first:

              li.append(first)

              first = first + 1

          print(li)

      

      elif len(last) == 2:

          while last[0] > first:

              li.append(first)

              first = first + last[1]

          print(li)

          

          

      else:

          i=0

          

          while i < first:

              li.append(i)

              i= i + 1

          print(li)

You might be interested in
Which of the following are ways that
Viefleur [7K]

Answer:

A and b

Explanation:

3 0
3 years ago
One of the differences between a career and a job is that a career?
murzikaleks [220]
A job is more short-term oriented and tends to focus purely on earning money. ... On the other hand, a career is a series of related employment in one field that provides experience for your future and helps you earn a better paycheck and living status.
5 0
3 years ago
What mode is generally used when delivering a presentation to an audience?
dybincka [34]

Answer:

delivery mode

Explanation:

there it is

7 0
3 years ago
Read 2 more answers
QUESTION 4 of 10: True or False: According to the reading, investors care about your love for your business.
mixer [17]

Answer:

false

Explanation:

5 0
3 years ago
Read 2 more answers
Technician a says that impact sockets have thicker walls than conventional sockets. Technician b says that impact sockets have a
Ray Of Light [21]

Impact sockets are sockets used to cope with the vibration caused by the impact of the hammer on the anvil. Both technicians are right. It is true that impact sockets have thicker walls than conventional sockets, so technician A is right. But it is also true that impact sockets have a black oxide finish, so the technician B is also right.

4 0
3 years ago
Other questions:
  • what is the goal of technology A. to understand how the natural world functions B. to study the natural world C. to improve the
    9·1 answer
  • How do you make electricity
    10·1 answer
  • Give an example of an outdated memory or storage device what do you think they are outdated
    12·1 answer
  • You're the network administrator for a company that has just expanded from one floor to two floors of a large building, and the
    13·1 answer
  • FOR ALL PLATO USERS:
    10·2 answers
  • Voltage drop across the resistor
    9·1 answer
  • Anybody know this question???
    6·1 answer
  • Plz answer -----------
    11·2 answers
  • How is an interpreter different from a compiler?
    9·2 answers
  • What does a computer monitor look like when struck really hard?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!