Question: Using Python Start by assigning to variables monthsL and monthsT a list and a tuple, respectively, both containing strings 'Jan', 'Feb', 'Mar', and 'May', in
Using Python
Start by assigning to variables monthsL and monthsT a list and a tuple, respectively, both containing strings 'Jan', 'Feb', 'Mar', and 'May', in that order.
Then attempt the following with both containers:
(a) Insert string 'Apr' between 'Mar' and 'May'.
(b) Append string 'Jun'.
(c) Pop the container.
(d) Remove the second item in the container.
(e) Reverse the order of items in the container.
(f) Sort the container.
Note: when attempting these on tuple monthsT you should expect errors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
