Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to make a program in python that's similar to the range function within python, but it generates a list of numbers rather than one.

How to make a program in python that's similar to the range function within python, but it generates a list of numbers rather than one.

image text in transcribed

Define a test a function myRange. This function should behave like Python's standard range function, with the required and optional arguments, but it 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 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 of counting up or down. Sample output: 246-:-> [2] 24 l 2, 3 0 51> [o, 1, 2, 3, 4] 4 2 -1 > [4, 3]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

define the term outplacement

Answered: 1 week ago

Question

describe the services that an outplacement consultancy may provide.

Answered: 1 week ago