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
Write the simplest statement that prints the following on a single line: 3 2 1 Go! Note: Whitespace (blank spaces / blank lines)
Olin [163]

Answer:

//here is the statement in java.

import java.util.*;

//class definition

class Solution

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // this statement will print the 3 2 1 Go! and go to newline

       System.out.println("3 2 1 Go!");

   }catch(Exception ex){

       return;}

}

}

Explanation:

We can use "System.out.println()" to print the required output same as it required. After printing this, it will go to newline.

Output:

3 2 1 Go!

4 0
2 years ago
File formats are linked to certain programs.<br><br> True<br> False
Lostsunrise [7]
What was the answer?
7 0
3 years ago
Read 2 more answers
1. Ce este o baza de date? (1p)
lesya [120]

Answer:

would you mind telling me what this says im still learning my spanish

Explanation:

6 0
2 years ago
Read 2 more answers
Alguien que me pueda ayudar diciéndome las características de Visual Object en programacion porfavor?!
Verizon [17]

Answer:

vvbdndndndndndnznmzxbbsvs

kgkgcicgfhjgyofdhkdyfjfgeghehehehehsbbsbsb

PLS HELP ??? LOL INEED HELP ITS TOO HARD

5 0
3 years ago
Jack needs to improve sales on a local service for the elderly. What would be the best place for him to place an ad?
Lorico [155]

Answer: D

Local news channels

Explanation:

Since Jack is trying to improve local service the local news would be the best fit to reach the maximum amount of people in his area.

3 0
3 years ago
Read 2 more answers
Other questions:
  • You manage an NLB cluster composed of three servers: Server1, Server2 and Server3. Your maintenance schedule indicates that Serv
    15·1 answer
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    8·2 answers
  • What date does GTA 6 come out<br> A. 2020<br> B. 2019<br> C. 2021<br> D. 2022
    10·2 answers
  • How do you change your age on Brainly?
    10·1 answer
  • Which page in a web site do viewers usually see first?
    15·1 answer
  • Devices which are used to receive data from central processing unit are classified as
    11·1 answer
  • Complete each sentence using the drop-down menu. Information on local driving laws can be found on a website. A class textbook c
    9·2 answers
  • The movie polar express was critically acclaimed due to the unbelievably lifelike movements of Tom Hanks character
    13·1 answer
  • The reason why our computers can get faster without getting bigger is because of...
    14·1 answer
  • Define a query that uses the Natural Join command to join three tables to produce useful information.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!