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
This type of technology does not come with a keyboard or mouse for input
olga55 [171]
Maybe a tablet.... who knows what is this for?

6 0
3 years ago
Read 2 more answers
What is the code for loading image in matlab
MA_775_DIABLO [31]

Answer: Using imread command

Explanation:

For loading images in matlab we can use the imread command. Some example regarding how to use the code is as follows:

A = imread('ball.tif');

Here suppose the image file name is saved as ball and is in tif format. Here the image is stored in an array named A.

We can view the image using

imshow(A);

7 0
4 years ago
8.1.4: Ghost Invasion!
Natalija [7]

the fat car has a lot to pass on PC Dell is the only thing to

8 0
2 years ago
How is sharepoint used in organization today?
tatyana61 [14]
<span>To build a team site and collaborate with your colleagues</span>
8 0
3 years ago
CIST 1122 Project 2 Instructions
NikAS [45]

Answer:

it is suppost ro be at

least 20 tb

Explanation:

5 0
3 years ago
Other questions:
  • Which of the following is not a common network architecture type?
    9·1 answer
  • Differences between electromechanical era and electronic era in point.<br>PLZ HELP​
    6·1 answer
  • Claire is trying to listen to her history professor's lecture, but her mind keeps wandering to thoughts about her plans for the
    5·1 answer
  • Who is hurt by piracy
    10·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • What is the missing line of code?
    7·1 answer
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • How do you get off of the comments after you look at them wit out going all the way off the app?
    15·1 answer
  • In two to three sentences, define "home row" and explain why it is important.
    6·2 answers
  • X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be stacked to form a pyramid with
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!