Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python List Comprehension

fruits = ['Banana', 'Apple', 'Lime']
loud_fruits = [fruit.upper() for fruit in fruits]
print(loud_fruits)

# Output
# ['BANANA', 'APPLE', 'LIME']
Source by www.pythontutorial.net #
 
PREVIOUS NEXT
Tagged: #Python #List #Comprehension
ADD COMMENT
Topic
Name
6+4 =