# Storing related pieces of information # With what we know: requires multiple variables facebook_friend1 = "Kelly" facebook_friend2 = "John" facebook_friend3 = "Nhat" # Problems? # cumbersome # adding a new friend # repeating a task for all friends # Where this comes up # Data collection # Social network (lists of friends) # Solution: LISTS # Container for multiple pieces of information # Way to access that info through a single variable # list of strings facebook_friends = ["Kelly", "John", "Nhat"] # list of integers blood_pressure = [50, 52, 55, 50] #displaying elements print(facebook_friends) # selecting a specific element print(facebook_friends[2]) # adding elements facebook_friends.append("Tamim") print(facebook_friends) # sorting it facebook_friends.sort() print(facebook_friends) facebook_friends.remove("Kelly") print(facebook_friends) facebook_friends[0] = "Vincent" print(facebook_friends) # Doing same thing for every element in a list for friend in facebook_friends: print friend * 2