Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 4 : Working with lists In [ ] : food = [ ' ranen ' , 'potato', 'chicken nuggets', 'pineapple' ] 4 a .

Task 4: Working with lists
In []: food =['ranen', 'potato', 'chicken nuggets', 'pineapple']
4a. Pri
In []:
4b. Change 'potato' to another food (and print the whole list to check).
In []:
4c. Ac
In []:
4d. Use slicing to view the 3rd to last items of the list.
In []:
4e. Reverse the list!
In []:
4f. List comprehension
List comprehension allows you to make a new list by performing some operation on each item of an existing list. You can read more about it here.
Use list comprehension to create a new list of all the foods in the food list that contain the letter e.
In []:
In []:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

=+3. Is pay for performance effective? Why or why not?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago