Hi,
I am quite new to Python & recently I have been given an assignment to create a list of dictionaries.
Can anyone give me an idea of how to do so?
Let say, my dictionary will have 3 keys: "FirstName" , "LastName" , and "SSID".
So the expected output would be:
dictList = [ {'FirstName': 'Michael', 'LastName': 'Kirk', 'SSID': '224567'},
{'FirstName': 'Linda', 'LastName': 'Matthew', 'SSID': '123456'},
{'FirstName': 'Sandra', 'LastName': 'Parkin', 'SSID': '123456'},
{'FirstName': 'Bob', 'LastName': 'Henry', 'SSID': '666666'},
{'FirstName': 'Silvia', 'LastName': 'Perkin', 'SSID': '676767'}]
And assuming after having the above list, how can I retrieve the info of each dictionary entry?
Thanks in advance
Leny
I am quite new to Python & recently I have been given an assignment to create a list of dictionaries.
Can anyone give me an idea of how to do so?
Let say, my dictionary will have 3 keys: "FirstName" , "LastName" , and "SSID".
So the expected output would be:
dictList = [ {'FirstName': 'Michael', 'LastName': 'Kirk', 'SSID': '224567'},
{'FirstName': 'Linda', 'LastName': 'Matthew', 'SSID': '123456'},
{'FirstName': 'Sandra', 'LastName': 'Parkin', 'SSID': '123456'},
{'FirstName': 'Bob', 'LastName': 'Henry', 'SSID': '666666'},
{'FirstName': 'Silvia', 'LastName': 'Perkin', 'SSID': '676767'}]
And assuming after having the above list, how can I retrieve the info of each dictionary entry?
Thanks in advance
Leny
Comment