Question: Create a function bookend_list that consumes a list of integers as a parameter and returns the first and last elements as a new list.
Create a function bookend_list that consumes a list of integers as a parameter and returns the first and last elements as a new list. If the original list is empty, return an empty list instead. Unit test this function sufficiently. To give the type parameter of a list of integers, use [int]. Console: Evaluate Run Variables Decisions Iteration Split Text from cisc108 import assert_equal Blocks Reset Import datasets Feedback: Unused Variable The function assert_equal was given a definition on line 1, but was never used after that. Upload X History 1 from cisc108 import assert_equal 2 3 View Trace
Step by Step Solution
There are 3 Steps involved in it
To solve this problem you need to create a function called bookendlist that takes a list of integers ... View full answer
Get step-by-step solutions from verified subject matter experts
