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]
2 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]2 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]2 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
As the team leader, John ensures that all his teammates are clear in the team goals they need to achieve. He demonstrates the qu
zimovet [89]

Delegation ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

7 0
3 years ago
Read 2 more answers
Can both mediated interpersonal communication and mass communication has an ability to reach huge number of recipients or audien
mars1129 [50]

Answer:

Explanation:

Somewhat

7 0
2 years ago
Compare and contrast the role that business users play when software is developed using Waterfall and Agile software development
qaws [65]

Answer: Both Agile and waterfall model are software development models to deliver a final outcome in the form of a software product. Waterfall model is sequential process with the requirements beings rigid and defined before beginning the software development.

Agile method basically  concerned with the requirements of the client. Here both testing and development is carried out at the same time.

Explanation:

More differences between the two include :

Waterfall model is easy to manage whereas in agile model as the the client requirements changes and wants more functionalities is becomes a bit more difficult to manage. the role of project manager is very crucial in waterfall model whereas the role of developers ans testers is more important in Agile model.

8 0
3 years ago
C programming:
mixas84 [53]
IsTeenager = ( ( kidAge >= 13 ) && ( kidAge <= 19 ) ) ? true : false;

Another way:

if( ( kidAge >= 13 ) && ( kidAge <= 19 ) )
  isTeenager = true;
else
   isTeenager = false;
8 0
3 years ago
You compared each letter in the correct word to the letter guessed.
Murrr4er [49]

Answer:

wow

Explanation:

www

7 0
2 years ago
Other questions:
  • Write a while statement that prints all even numbers between 1 and 100 to the screen.
    6·1 answer
  • The total revenues for a company are $150,223 and the total expenses were 125,766. If you are calculating the net income, which
    10·1 answer
  • 0.005098 megaliters to liters. record your answer in whole liters
    7·1 answer
  • Ergonomically designed workstations and equipment reduce stress-related injuries and improve the productivity and efficiency of
    13·2 answers
  • Name the three basic storage device of a computer​
    6·2 answers
  • A technician has been asked to upgrade a processor and needs to do some research. The computer is just a couple of years old. Wh
    13·1 answer
  • Why must you be careful when handling a hard drive?
    10·1 answer
  • k-means clustering cannot be used to perform hierarchical clustering as it requires k (number of clusters) as an input parameter
    15·1 answer
  • We will create a shopping cart, it is a dictionary mapping items in the car to the amount of that item. For example if there is
    9·1 answer
  • High level language is___________
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!