Question: Python programming 1. Define a list called fruits that contains the following fruits: apple, banana, orange, lime, strawberry. 2. Write one or more statements to
1. Define a list called fruits that contains the following fruits: apple, banana, orange, lime, strawberry. 2. Write one or more statements to add at least two more fruits to the end of the list. 3. Write a statement that prints the number of elements in the ist. 4. Write a general statement that prints just the last fruit in the list. 5. Write a loop that prints each item in the list, one line at a time. 6. Write a statement that inserts the fruit, "lemon", to the list. 7. Write a statement that takes a slice of the array that includes the 2nd-4th elements of the array. 8. Write a single statement that returns a copy of the last half of the array. 9. Write a statement that makes a copy of the array. 10. Write code to check and see if "strawberry" is in the list. If it is, print "Shortcake! 11. Write a loop that prints each fruit that contains more than 5 letters. 12. Write a statement that sorts the fruits list in alphabetical order 13. Write a statement that removes "lime" from the list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
