# Data Structures in Python ''' List [el1, el2, ...] indexed, len(4), range[0-3], dups, add/change Set {item1, item2, ...} !indexed !sorted !dups Tuple (param1, param2, item1, ...) immutable, dups Dictionary "Map" {key1: value, key2: value,...} kayName!dup ''' # Lists page 25 [] firstNames = ["Bob","Joe","Mary"] # type function shows what the variable type is print( type(firstNames) ) newContact = input("Enter contact first name: ") firstNames.append(newContact) # firstNames[0] = 'Robert' # for x in ys # x local variable in scope / sub operation # ys where is my data coming from? position = 0 for firstName in firstNames: # len(3) print("ID: " + str(position) + " Contact first name: " + firstName + ".") position += 1 updateContactID = int(input("What ID do you want to update?: ")) # listName[positionalIndexID] firstNames[updateContactID] = input("Contact updated name?: ") position = 0 for firstName in firstNames: # len(3) print("ID: " + str(position) + " Contact first name: " + firstName + ".") position += 1 # Dictionary Page 28-29 # Ask the user for the inputs() FIRSTNAME = input("Enter contact first name: ") LASTNAME = input("Enter contact last name: ") contact = { 'fname': FIRSTNAME, 'lname': LASTNAME, 'age': 21, 'instructor': True } # contact fullname = contact['fname'] + ' ' + contact['lname'] print(fullname) # Philip Matusiak