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
sukhopar [10]
3 years ago
13

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

ional arguments. 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:
Reil [10]3 years ago
4 0

Answer:

YOU DONT HAVE A QUESTION ITS A LONG STATEMENT

Explanation:

Sloan [31]3 years ago
4 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)

                  

   except:

       print("Ran expected at most three arguments at most got", len(last)+1)

   

 

Explanation:

#section 1

The function is defined and a list is created to hold the range of values specified.

It is important to note that the function was created using one required argument and using by *args (*last), The function is allowed to accept extra positional arguments.

#section 2

In this section, we limit the extra positional arguments to two using a try and except block and raising a value error anytime a positional arguments more than three (remember we have 1 required argument) is entered.

The *args supply their arguments in a tuple.

Finally, within the try and except block depending on the arguments given; IF, ELIF and ELSE blocks are available to take those arguments and return the appropriate answer to generate the required range of values

You might be interested in
There are over 150 free themes on Wordpress.com. Which of the following is a common feature for which you can filter your theme
Oduvanchick [21]

Answer:

A responsive layout is usually a common and important aspect of a theme since it can allow users to use different devices and receive a proper satisfactory visit.

Explanation:

Depending on the purpose of the site, you need to be decided what functionalities you deem necessary and which are just useful in case you might need it later on. Example

A blog site will required a good blog theme,

including one that has ecommerce options depends weather the blogger might be thinking of selling things or not.

8 0
3 years ago
Give 8 examples of Synchronous communication
SpyIntel [72]

Answer:

Synchronous communication examplesinclude: instant messaging, video conferencing, webcams, MUDs, MOOs, chat, Second Life. Examples of one-to-one synchronous communication include: instant messaging. Examples of one-to-manysynchronous communication include: video conferencing, MUDs, and MOOs.

5 0
3 years ago
Paula is working on a project for an iOS app that will show action clips with special effects to promote a new musical drama. Th
Goryan [66]

Answer:

she is creating a effective app.

Explanation:

6 0
3 years ago
Connection-oriented protocols protect against dropped data by forming connections and using what type of constant stream?
nataly862011 [7]

Answer:

A real constany

Explanation:

5 0
3 years ago
a ------------ insurance policy covers a business during the restoration period after a natural disaster
cricket20 [7]

Answer:

Business Interruption

Explanation:

just took on apex

5 0
3 years ago
Read 2 more answers
Other questions:
  • Quote one of morrie's aphorisms and explain what you think it means (page 18).
    14·1 answer
  • The faster the clock speed, the more of these the processor can execute per second. what are they?
    15·2 answers
  • What does the action tool allow you to do in Microsoft Powerpoint?
    15·1 answer
  • Using the employment websites, search for part-time jobs that relate to the career fields you are interested in pursuing or to y
    12·2 answers
  • Write a flowchart and program that does the following: Asks the user for the average temperature in each of the last 12 months A
    12·1 answer
  • Which of the following events happened first
    15·2 answers
  • 1. Define the term Intranet.
    10·1 answer
  • 2. What is the first part of the 3D printing process ?
    11·1 answer
  • Write a python program to calculate the sum of three numbers and as well require the user to input the numbers.​
    12·1 answer
  • When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor, technicians must?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!