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
Which tab should be selected to add a hyperlink within a cell? Home tab Review tab Insert tab Formula tab
Mashcka [7]

Answer:

On the Insert tab

Explanation:

  1. You would select the tab that you want the Hyperlink to be in
  2. select the <em>Insert tab</em>
  3. There you will see a panel that says<em> link</em> press the down arrow than you will see a section that says <em>link</em> again there again you will press the down arrow which will show a option of document you want to add if your looking to add a link form a web browser than at the bottom of the list you will see <em>Insert Link</em>
  4. From there you will see a box pops up there you can upload a file from your computer or PC
  5. Once the box pops up you will enter the web browser page address in the box that says <em>address</em>
  6. From there press <em>okay</em> then your hyperlink will be in the cell you want
  7. If you don't know where or what a web browser address is than on the top of the web browser where you would insert what you are searching all you have to do is press it and it will automatically highlight the text than copy and paste the text by holding <em>Ctrl + C </em>to copy and holding <em>Ctrl + V </em>to paste

6 0
3 years ago
Read 2 more answers
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
3 years ago
How do you find a single number or name you want in a
Tamiku [17]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

You can find a single number or name in a large worksheet containing thousands of numbers and names using the find and replacement feature in excel.

You can use Ctrl+F keyboard shortcut for finding and replacing features. When you press Ctrl+F, a dialog will get open, using this dialog, you can find the required number or name while entering in the search text box. Then, click on the Find button, if the worksheet matches the result, give you the matched result in the yellow highlighted color.

Also, you can use Ctrl+F to replace a name or number with some other name or number.

Alternatively, you can do this using the home tab, then find the option find and select under the editing group of commands.

8 0
3 years ago
What type of storage drive contains multiple spinning platters?
Gala2k [10]

The type of storage drive that contains multiple spinning platters is called; Hard disk drives

<h3>What is the hard disk drive?</h3>

A computer hard disk drive (HDD) is a non-volatile data storage device. Non-volatile refers to storage devices that maintain stored data when turned off.

Now, the correct answer to the question is hard disk drives. This is because a hard disk drive is comprised of a stack of spinning metal disks known as platters. Each spinning disk has trillions of tiny fragments that could possibly be magnetized in order to represent bits (1s and 0s in binary code).

Read more about Hard disk drives at; brainly.com/question/24498473

#SPJ12

8 0
2 years ago
PLATO
storchak [24]

Answer: here is the answer ☀️keep on shining☀️

Explanation:

5 0
3 years ago
Other questions:
  • Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    7·1 answer
  • What is software that helps a computer operate efficiently and keeps track of data on a computer?
    14·1 answer
  • Garry is a record executive who is building a data table to include in a presentation about one of his artists. The table is mea
    15·1 answer
  • Jim is writing a program to calculate the wages of workers in a teddy bear factory.
    7·1 answer
  • Why we call the standard deviation of the sample statistic asstandard error of the statistic?
    14·1 answer
  • Ask the user to input a word. Then, print the first letter, the last letter, and the length of the word on the same line with no
    6·1 answer
  • A signal has a wavelength of 1 11m in air. How far can the front of the wave travel during 1000 periods?
    7·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • A hub is a central computer true or false?
    13·2 answers
  • In how many positions are there nucleotide differences between your query sequence and the sequence of accession AY259214.1
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!