Question: Assume you have a list called lst . The expression _ _ _ _ _ _ _ _ _ _ _ results in a list

Assume you have a list called lst . The expression ___________ results in a list containing the next to the last element and the last element in lst . Assume the length of lst is large enough to support the operation.
For example, assume that lst is:
lst =[8,14,32,66,89,75,43,22,16,2]
then your expression should result in:
[16,2]
Another example, assume that lst is:
lst =['z','e','b','r','a','s']
then your expression should result in:
['a','s']
Note: your answer should not contain the print statement! Also, lst starts with the letter l(el) NOT the number one!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!