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
Users browsing this thread: 1 Guest(s)