Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
To solve this problem you need to create a function called bookendlist that takes a list of integers ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started