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
34kurt
3 years ago
15

Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new list of only the first and l

ast elements of the given list (eg. [5, 25]). If the input list is [5], the returned should be [5,5]. The function should return an empty list if an empty list is passed in. The function should not use any variables besides the passed in argument list_.
def endpoints(it) -> list: # YOUR CODE HERE raise NotImplementedError() ] ### BEGIN TESTS assert endpoints([5, 10, 15, 20, 251) -- 15, 25] **# END TESTS U # BEGIN TESTS assert endpoints([5]) - (5, 51 *** END TESTS [] ### BEGIN TESTS assert endpoints(0) -- 0 #*# END TESTS
Computers and Technology
1 answer:
Ne4ueva [31]3 years ago
5 0

I included a picture of my code below. Best of luck with your assignment.

You might be interested in
Access time is:________.
worty [1.4K]

Answer:

B) the time it takes for the required sector to position itself under the read/write head.

Explanation:

In Computer science, Access time is the time it takes for the required sector to position itself under the read/write head. It is usually measured in milliseconds.

It is the speed of the storage device.

5 0
3 years ago
40 points!!! Which of the following is a disadvantage of outsourcing?
mr Goodwill [35]

Answer:

c

Explanation:

I need 20 characters in my answer so tvcogct7zr7zuruzxicfficx7t8txr8zz8rz8rxt8c8tvyovoyb9h

8 0
3 years ago
Read 2 more answers
Hidden-surface removal is the process of:
castortr0y [4]

Answer:

Option A.

Explanation:

In 3D computer graphics, this process determines which elements should not be visible from the desired point of view, and will prevent them from rendering. Thus, objects that lie behind opaque surfaces such as walls or panels, will not be rendered.

A good rendering algorithm helps to optimize the graphic engine because it will load as few elements as possible. Therefore, in larger worlds, the engine will remain at a stable speed and will be more efficient.

3 0
3 years ago
Write a loop that sets each vector element to the sum of itself and the next element, except for the last element which stays th
Gekata [30.6K]

Answer:

Add the following lines of code to the already existing code segment

<em>for (i = 0; i < SCORES_SIZE-1; ++i) { </em>

<em>        bonusScores.at(i) = bonusScores.at(i) + bonusScores.at(i+1);</em>

<em>  }</em>

Explanation:

To do the task in the question, we have to iterate through the vector from the first element i.e. element at index 0 to the second to the last element; i.e. element at last index - 1

We then add each element in this iteration with the next.

This iterates through the vector from 0 to SCORES_SIZE - 1

<em>for (i = 0; i < SCORES_SIZE-1; ++i) { </em>

<em>This adds each vector element with the next</em>

<em>        bonusScores.at(i) = bonusScores.at(i) + bonusScores.at(i+1);</em>

<em>  }</em>

The above should be added before

<em>for (i = 0; i < SCORES_SIZE; ++i) { </em>

<em>        cout << bonusScores.at(i) << " "; </em>

<em>}</em>

<em />

<em>Also, I've made other modifications to the program.</em>

  • <em>Proper import of header files</em>
  • <em>Proper declaration of vector bonusScores</em>

<em />

<em>See attachment for complete source code</em>

Download cpp
6 0
3 years ago
Which tab will you use to format data in cells?
kaheart [24]

Answer:

It's home tab

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • Jamie has to enter names, grades, and scores of a group of students into a worksheet. Which option will Jamie use to describe th
    11·1 answer
  • Which wireless technology has a typical transfer rate of 1 Mbps to 3 Mbps at distances up to about 10 meters?
    7·1 answer
  • The flagging of an uncommon last name as a spelling error can be stopped by opening the shortcut menu on the first occurrence of
    7·1 answer
  • The chief reason that family and friends are frequent targets of aggression is that
    6·1 answer
  • What are the advantages of AI?????
    9·1 answer
  • Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
    15·1 answer
  • Hydraulic systems use liquids because _____.
    14·2 answers
  • What factor(s) should be considered when determining whether a business is too far based on the query and the user location? Sel
    10·1 answer
  • Given the following structure and variable definitions, struct customer { char lastName[ 15 ]; char firstName[ 15 ]; unsigned in
    6·1 answer
  • What is one advantage of hard-disk recording?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!