keyIDs = list(jsonData.keys()) #list of IDs listOfValsFromKeys = students[keyIDs[i] for i in range(len(keyIDs))] #list of namesWhen I run the lines above, I get a syntax error in between the 'for' and the 'i'. I cannot work out why this is the case. Could someone enlighten me?
Creating a list from a comprehension using a list
Creating a list from a comprehension using a list
|
|
Messages In This Thread |
Creating a list from a comprehension using a list - by rm197 - Sep-30-2019, 06:23 PM
RE: Creating a list from a comprehension using a list - by stullis - Sep-30-2019, 06:41 PM
RE: Creating a list from a comprehension using a list - by rm197 - Sep-30-2019, 06:43 PM
RE: Creating a list from a comprehension using a list - by stullis - Sep-30-2019, 06:46 PM
RE: Creating a list from a comprehension using a list - by rm197 - Sep-30-2019, 06:52 PM
RE: Creating a list from a comprehension using a list - by stullis - Sep-30-2019, 06:54 PM
RE: Creating a list from a comprehension using a list - by rm197 - Sep-30-2019, 07:02 PM
|
Users browsing this thread: 2 Guest(s)