answer.
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]
1 year 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]1 year 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]1 year 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 Internet of Things (IoT) challenge involves the difficulty of developing and implementing protocols that allow devices to
dolphi86 [110]

Answer:

Option C i.e., Interoperability is the correct option

Explanation:

Interoperability performs for computers or its components for the purpose to communicate and it is important to improve the development of the Internet of Things. It performs the communication as well as share their services between computer or its components.

It also contains challenges occurred at the time of developing and implementing the protocols by which they communicate.

7 0
2 years ago
Garrett wants to search through a csv file to find all rows that have either the name John or Bob in them and display them out t
Olin [163]

Answer:

A.  grep -E "(John|Bob)" salesemployees.csv

Explanation:

The grep command is used to search text. It searches the given file for lines containing a match to the given strings or words.

How to use Grep Command:

grep 'letter' filename – Search any line that contains word 'letter' in filename on Linux

grep -i 'Alphabet' file1 – A case-insensitive search for the word ‘Alphabet’ in Linux and Unix

grep -R 'root' . – Search all files in the current directory and in all of its subdirectories in Linux for the word ‘root’

8 0
1 year ago
Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
Ghella [55]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is an online decision support system. Because the decision support systems process the data, evaluate and predict the decision, and helps the decision-makers,  and offer real-time information immediately in making the decision in an organization. So the correct answer to this question is the decision supports system.

Why other options are not correct

Because the transaction processing system can only process the transaction and have not the capability to make the decision for the future. Office support processing system support office work, while the batch processing system process the task into the batch without user involvement.   however, online executive processing does not make decisions and offer timely information to decision-makers in an organization.

3 0
2 years ago
Suppose your company has decided that it needs to make certain busy servers faster. Processes in the workload spend 60% of their
vekshin1

Answer:

CPU need 50% much faster

disk need 100% much faster

Explanation:

given data

workload spend time CPU  = 60%

workload spend time I/O = 40%

achieve overall system speedup = 25%

to find out

How much faster does CPU need and How much faster does the disk need

solution

we apply here Amdahl’s law for the overall speed of a computer that is express as

S = \frac{1}{(1-f)+ \frac{f}{k} }      .............................1

here f is fraction of work i.e 0.6 and S is overall speed  i.e 100% + 25% = 125 % and k is speed up of component

so put all value in equation 1 we get

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.6)+ \frac{0.6}{k} }  

solve we get

k = 1.5

so we can say  CPU need 50% much faster

and

when f = 0.4 and S = 125 %

put the value in equation 1

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.4)+ \frac{0.4}{k} }  

solve we get

k = 2

so here disk need 100% much faster

7 0
1 year ago
_____ remove the part of an image starting from an edge​
Lapatulllka [165]
I think it’s cropping could be wrong though
4 0
1 year ago
Other questions:
  • Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.
    11·1 answer
  • Create a generic class Box with a type parameter that simulates drawing an item at random out of a box. This class could be used
    7·1 answer
  • Write a recursive method called printNumPattern() to output the following number pattern. Given a positive integer as input (Ex:
    5·1 answer
  • How is the IT function organized in your school or place of employment? Create an organization chart showing how the IT organiza
    7·1 answer
  • Sensors and devices connected to a model are examples of which of the following?
    6·2 answers
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
    12·1 answer
  • Which option in the Caption dialog box configures whether the caption appears above or below the image
    11·2 answers
  • What do you call the two parts of lift that go down a mine
    13·2 answers
  • TQ Artificial Intelligence (AI)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!