November 11, 2019
Python
In Python, tuples are like lists, but they are immutable. They cannot be changed. Use ( ) when creating a tuple, instead of [ ] - list. You can unpack a tuple by assigning variables to the contents of a tuple.
Loops that let us move through each item in a list are called for loops.
Loops that keep going until we tell them to stop are called while loops.
Loops that create new lists are called list comprehensions.
List comprehensions are one of the easiest and most efficient ways to create lists in Python.
Make changes to every item in a list - [operation for every item in list]
—- new_list = [temp + 20 for temp in temperatures]