I'm having trouble with my code sorting correctly.
def generateList(attendeeList, criteria, workshoptitle):
for i in attendeeList:
if(criteria == 'Workshop1'):
criteria = 'Workshop B'
if(i['session1'] == criteria ):
temp = []
temp.append((i['lastname']))
temp.sort()
print(temp)
The output doesn't come out sorted by lastname
['Smith']
['Robertson']
['Lovelace']
['Yu']