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
What system calls have to be executed by a command interpreter? Why is it usually separate from the kernel?
Licemer1 [7]

Answer:

The exec command by interpreter to start new process

Explanation:

On Unix systems, a call to the fork system must be made followed by a call to the e x e c system to begin a new process. The fork call clones the process that is currently running, while the executive call overlays a new process based on a different executable over the calling process.

It is seperate from Kernal because

It Read user commands or a script and execute them, generally turning them into one or more system calls. Is usual It is not part of the kernel since the command interpreter is subject to change.

6 0
3 years ago
Which is not a MARKETING impact of technology?
Artist 52 [7]

Answer:

the answer is environmental

6 0
3 years ago
If I write too much for an exam answer, do I get downgraded?
Degger [83]

Answer:

I don't think so

Explanation:

4 0
3 years ago
Why is democracy the best form of government
julia-pushkina [17]

Democracy is the best form of government simply because no other form of government is known to work well. Democracy may have its flaws but all in all it .

3 0
3 years ago
What are the main types of reading tools? Check all that apply. please HELP​
vovangra [49]

Answer:

Comprehension

reference

3 0
3 years ago
Other questions:
  • Free points! your welcome
    9·2 answers
  • A word processing program would probably be used to: 
    8·1 answer
  • Write a function to sum the following series:
    8·1 answer
  • What items do you keep in a data base
    5·1 answer
  • An ink-jet printer is a type of impact printer. <br> a. True <br> b. False
    8·1 answer
  • ) Which is true about the agile method?
    7·1 answer
  • A website's ____ page provides basic information about the individual or organization and includes a navigation bar with links t
    13·1 answer
  • What is an Apple Pen?
    5·2 answers
  • Explain how SEO impacts the way you should interpret search engine results ???
    6·1 answer
  • 1. Identify one modern technology and discuss its development and discuss what future changes might occur that could have an eve
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!