Lists
Lists in Python
my_list = [1,2,3,4,5]
print(type(my_list))
# prints listWhat you can do with lists:
my_list.pop()
# This is a mutable object
# Since it is a mutable object you don't have to reassign it to itself
# i.e my_list = my_list.pop()
# It will print the list: [1,2,3,4]
# To pop out the first value:
my_list.pop(0)
# If you capture the retured value
sentence = my_list.pop()
print(my_list) # This will still be the appended list
print(sentence) # But the poped item is stored in this variableLast updated