subject

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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
You know the right answer?
Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new...
Questions
question
Mathematics, 03.10.2021 08:10
question
Social Studies, 03.10.2021 08:10
Questions on the website: 13722362