Welcome to Python.org – Speedlink3 Communication And Technologies
Technologies

Welcome to Python.org


# Python 3: List comprehensions >>> fruits = [‘Banana’, ‘Apple’, ‘Lime’] >>> loud_fruits = [fruit.upper() for fruit in fruits] >>> print(loud_fruits) [‘BANANA’, ‘APPLE’, ‘LIME’] # List and the enumerate function >>> list(enumerate(fruits)) [(0, ‘Banana’), (1, ‘Apple’), (2, ‘Lime’)]

Source

Related Articles

Leave a Reply

Back to top button