Question: Python Language Lists, slicing and for statements. Given the list named pizzas : pizzas = ['cheese', 'pepperoni', 'margherita', 'hawaiian', 'italian sausage', 'green peppers and onions']

Python Language

Lists, slicing and for statements. Given the list named pizzas :

pizzas = ['cheese', 'pepperoni', 'margherita', 'hawaiian', 'italian sausage', 'green peppers and onions']

- Using for statements, the string method called find and the method of lists called append, append in the list loc_e the index of the first 'e' that appears in each element in the pizzas list, and print the list loc_e.

Note: The find method will return -1 if element is not found.

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!