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
What is output by the following program? int i = 7; while (i>=2){System.out.print (i +""); if ((i%3) == 0){ i +2; } else { i/
stiks02 [169]

Answer:

The correct answer to this question is: "this program give an error".

int i = 7; //declare a variable(i) and assign value.

while (i>=2) //use loop and check condition.i greater then equal to 2.

{

System.out.print (i +""); //print value of i.

if ((i%3) == 0) //hold remainder

{

i +2; //error.

}

else

{

i/=2; //hold Quotient

}

}

Explanation:

In the above program, there is an error in the if block because it is not the correct way to declare. To use the variable from the correct output we use a variable like this.

Example

int i = 7;

//declare a variable(i) and assign value.

while (i>=2)

//use loop and check condition.i greater then equal to 2.

{

System.out.print (i +""); //print value of i.

if ((i%3) == 0) //hold remainder

{

i =i+2;

}

else

{

i/=2; //hold Quotient

}

}

Output: 732

6 0
3 years ago
Join my discord server! CODE IS (CebjBXN)​
11Alexandr11 [23.1K]

Answer:

sure

Explanation:

7 0
3 years ago
Read 2 more answers
For this assignment your are to implement the Pet Class described in Programming Exercise 1, starting on page 494 in our textboo
choli [55]

Answer:

ohhhvhhffifyuddfuiicfdguc

5 0
3 years ago
Prewritten, commercially available sets of software programs that eliminate the need for a firm to write its own software progra
Irina18 [472]

Answer:

Option A i.e., software package.

Explanation:

Prewritten, available on the market the software packages, which not necessitate a company's desire to actually compose its software for certain functionalities, will be applied to as software packages.

A software package is essentially a finite number of programs or software components that function together so that they achieve different tasks and objectives.

5 0
3 years ago
Which of the following best describes a toolbar?
nataly862011 [7]
Easy fast access to common apps or programs

3 0
3 years ago
Other questions:
  • In what way(s) did the password you tried to use not meet the password policy requirements?
    14·1 answer
  • Help! live preview in brackets is not working
    8·1 answer
  • Charli's password was changed a couple of weeks ago because someone figured it out. Can someone go to a password generator and f
    5·2 answers
  • Sally needs to teach her class how to convert a decimal number to a binary number. What is the first step she should take to sta
    5·1 answer
  • What is text box and label control​
    10·2 answers
  • George is sketching a wireframe representation of the home page of his website. What aspect of the home page would be impossible
    11·1 answer
  • True or false? The following deterministic finite-state automaton recognizes the set of all bit strings such that the first bit
    7·1 answer
  • Citing Wikipedia as a reference is not considered a good practice because 1.leverages a neutral point of view. 2.hosts unopinion
    8·1 answer
  • Divide 111001 by 1101​
    7·1 answer
  • Davingould1115...................answer 3​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!