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
What is the function of the NOS? Select all that apply.
Zigmanuir [339]

Answer:

.network management

Explanation:

pls need brainliest

3 0
3 years ago
Read 2 more answers
Use the drop-down menus to complete statements about archiving and backing up data fileArchiving data files manages the size of
svetoff [14.1K]

Answer:

Archiving data files manages the size of a mailbox for  

✔ local

storage.

Creating an Outlook data file  

✔ protects

data files in storage on a computer.

Explanation:

Because its right.

3 0
3 years ago
Read 2 more answers
Leah deals with several file conversions every day.
Lelechka [254]
That’s not a question but good for her
5 0
3 years ago
Variablesallow us to manipulate data through the ___________.
gladu [14]

Answer:

Reference

Explanation:

Variables provide reference to the stored data value.

For example:

int i = 0;

Here i is a variable of type int with an initial value of 0. i is a reference to this stored value 0. Now if I want to update the data, I can do so using this reference.

i = 1;

Now the reference is used to manipulate the stored data and change it to 1. In a similar manner all updates to the value can be done using the variable reference.

8 0
3 years ago
What is the size of the key space if all 8 characters are randomly chosen 8-bit ascii characters?
Slav-nsk [51]
21...............................
4 0
3 years ago
Other questions:
  • would specify that only selected members of the payroll and human resources department would have the right to change sensitive
    11·1 answer
  • Microsoft Xbox operating system provides Xbox programmers with a set of common standards to use to access controllers, the Kinec
    6·1 answer
  • What does this say:<br> √ans
    6·2 answers
  • Professionals within the creative imaging fields must have which of the following items to showcase technical expertise?
    14·2 answers
  • The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
    13·1 answer
  • 0x400C (in hexadecimal)?
    8·1 answer
  • When did the mantle of the earth form
    14·2 answers
  • In order for bitlocker to protect the system volume without the aid of an external drive, your computer must:
    12·2 answers
  • Consider the following method, which is intended to return the index of the first negative integer in a given array of integers.
    14·1 answer
  • What approach do you prefer to take when creating presentations for class projects? Would you rather use software or create pres
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!