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 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
What group of plants produce fruit? question 2 options: gymnosperms nonvascular plants seedless vascular plants angiosperms
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, 11.10.2019 16:30
question
Mathematics, 11.10.2019 16:30
question
Mathematics, 11.10.2019 16:30
Questions on the website: 13722362