d = {'name': 'Alice', 'gender': 'F', 'age': 11} Ans: print(type(d)) # Output: <class 'dict'>
print(d['gender'])
d['phone_number'] = '333/444-5555'
print('age' in d) print('ssn' in d) # Output: True False
# Initialize dictionary: d = { } # Open input file fin = open("pet-info.txt", "r") # Throw away first line fin.readline( ) # Process information from file line = fin.readline( ) while line != "": fields = line.split(",") key = fields[0].strip( ) value = fields[1].strip( ) d[key] = value line.readline( ) fin.close( ) print(d)