Jan-12-2018, 08:52 PM
It should output the list with the dictionary with the changed values as specified in the second for loop, but it doesnt. Picture of output is included.
aliens = [] for l in range (1,30): alien_specs = {'speed':'high' , 'color':'blue' , 'points': 5 } aliens.append(alien_specs) for pi in aliens[:2]: if alien_specs['points'] == 5: alien_specs['speed'] = 'low' alien_specs['color'] = 'red' for j in aliens[:5]: print(j) print('.............................................')Im using python 3