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]
2 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]2 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]2 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
Which layer of the osi model defines functions related to data delivery, error recovery, and flow control?
Dominik [7]
Answer is the Transport Layer.
5 0
2 years ago
Why is computer science hardware needed to solve problems with computers?
dybincka [34]

Answer:

Computer science is the study of problems, problem-solving, and the solutions that come out of the problem-solving process. Given a problem, a computer scientist's goal is to develop an algorithm, a step-by-step list of instructions for solving any instance of the problem that might arise. ... Algorithms are solutions.

Explanation:

#CarryOnLearning

3 0
2 years ago
Unwanted emails are called:malware,phishing, spam or virus
Colt1911 [192]
1. Spam
2. Phishing
3. True
3 0
3 years ago
A device is sending out data at the rate of 1000 bps. How long does it take to send
vredina [299]

Answer:

0.01 second ; 0.008 seconds; 800 seconds

Explanation:

Given that:

Sending rate = 1000 bps

Rate of 1000 bps means that data is sent at a rate of 1000 bits per second

Hence, to send out 10 bits

1000 bits = 1 second

10 bits = x

1000x = 10

x = 10 / 1000

x = 0.01 second

2.)

A single character 8 - bits

1000 bits = 1 second

8 bits = (8 / 1000) seconds

= 0.008 seconds

3.)

100,000 characters = (8 * 100,000) = 800,000

1000 bits = 1 second

800,000 bits = (800,000 / 1000)

= 800 seconds

4 0
2 years ago
Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technicia
hammer [34]
It is both true that <span>Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technician B says that excessive wear adds to the length of a heater hose, and a replacement heater hose should be roughly three to four inches shorter than its predecessor.  So the asnwer is letter B.</span>
6 0
3 years ago
Other questions:
  • Which element of the security policy framework requires approval from upper management and applies to the entire organization?A.
    5·1 answer
  • Krystal recorded her times for all her cross-country meets this season. To sort her data showing the lowest times first, what wi
    14·2 answers
  • A user has been given Full Control permission to a shared folder. The user has been given Modify permission at the NTFS level to
    11·1 answer
  • g What advantage does a circuit-switched network have over a packet-switched network? What advantages does TDM have over FDM in
    10·2 answers
  • What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?
    13·1 answer
  • The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity;
    10·2 answers
  • Write a machine-language program to add the three numbers 2, –3, and 6 and output the sum on the output device. Write it in a fo
    11·1 answer
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • What is syllabus of diploma in computer after class 10​
    10·1 answer
  • So I tried asking for help with my code on stackoverflow but the people there were very condescending and mean plus my questions
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!