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
HELP PLEASE
Mashcka [7]

A typical example of a Soft skills based question will be "tell us about your interpersonal skills" and "tell us about your time management".

<h3>What are Soft skills?</h3>

Soft skills refers to skills and traits that help employees interact with others and succeed in a typical workplace.

Some example of Soft skills include:

  • interpersonal skills
  • communication skills
  • listening skills
  • time management
  • empathy skills etc

Hence, an example of a Soft skills based question will be "tell us about your interpersonal skills" and "tell us about your time management".

Read more about Soft skills

<em>brainly.com/question/8381292</em>

3 0
1 year ago
DIRECTIONS: Organize your desktop. Name the 5 folders based on the files given below. Organize your own desktop by sorting the g
dem82 [27]

Answer: Music, Documents, PowerPoints, Pictures/Videos, Audios

6 0
2 years ago
True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
Feliz [49]
The answer to question is true
5 0
3 years ago
Read 2 more answers
Which of the following transferable skills are generally the most look for in the it <br> field
kherson [118]

Answer:

mechanical, encryptions, communication, network admin, leadership, and teambuilding

Explanation:

6 0
2 years ago
Why is it important to have user accounts? describe the purpose, features and functions of user accounts (including administrato
TEA [102]
Its important to have user accounts so you can save data and maybe log in and out of a device/cmp to another one. The purpose of the user account is to help save your stuff and personalize your device. The features are more data storage to add up, and ability to make more accounts for others so each of you can personally have their own account and save their own data on their own. Administrator accounts are the highest and have the most power of all, they are in charge of everything, especially giving permission to apps you may have downloaded and removing system apps. Users rights are the tasks specific users can do to make sure no user has too much power or less so to speak and it means what you are able/not able to do as well.
5 0
3 years ago
Other questions:
  • Select the correct answer.
    8·2 answers
  • Write a program which can do a String Check if its Panagram or not!
    10·1 answer
  • James has been asked to build a low-profile computer for his friend to use as a home theater system. James needs to choose parts
    15·1 answer
  • CAD helps professionals to _____. create a technical drawing give directions to a new location calculate the interest rate of a
    13·2 answers
  • Pls help me
    5·1 answer
  • Suppose you are given a data set consisting of nominal attributes, such as color, which takes values such as red, blue, green et
    9·1 answer
  • Network topology is a direct representation of
    9·1 answer
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • The difrent between valid deductive argument and strong inductive argument? At least 2 example​
    6·1 answer
  • How do you think electronic spreadsheets have transformed businesses today?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!