At Westonci.ca, we make it easy to get the answers you need from a community of informed and experienced contributors. Experience the ease of finding accurate answers to your questions from a knowledgeable community of professionals. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

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 last 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


Sagot :

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

View image Cytokine
We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We hope this was helpful. Please come back whenever you need more information or answers to your queries. Keep exploring Westonci.ca for more insightful answers to your questions. We're here to help.