aliens = [] alien_0 = {'color': 'red', 'points': 5, 'speed': 'slow'} for number in range(30): aliens.append(alien_0) for i in aliens[:3]: if i['color'] == 'red': i['color'] = 'green' i['points'] = '10' i['speed'] = 'medium' for alien in aliens[:5]: print(alien) print(f'the totla number of alien is {len(aliens)}')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)