You have already completed these exercises!
Do you want to take them again?
You completed the Python List Comprehension Exercises from W3Schools.com
Share on:
Consider the following code:fruits = ['apple', 'banana', 'cherry']newlist = [x for x in fruits if x == 'banana']What will be the value of newlist?
fruits = ['apple', 'banana', 'cherry']newlist = [x for x in fruits if x == 'banana']
newlist
['apple', 'cherry']
['banana']
True