|
楼主 |
发表于 2018-8-20 21:16:48
|
显示全部楼层
我实现出来是这个样子的,不仅仅前三个变成黄色,全部都变成了黄色
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
===== RESTART: C:/Users/WangDong/Desktop/复习/python/class1 入门学习/6.4嵌套.py =====
{'color': 'red', 'points': 15, 'speed': 'quick'}
{'color': 'red', 'points': 15, 'speed': 'quick'}
{'color': 'red', 'points': 15, 'speed': 'quick'}
{'color': 'red', 'points': 15, 'speed': 'quick'}
{'color': 'red', 'points': 15, 'speed': 'quick'}
总共创建了30个外星人
aasqas
{'color': 'yellow', 'points': 10, 'speed': 'medium'}
{'color': 'yellow', 'points': 10, 'speed': 'medium'}
{'color': 'yellow', 'points': 10, 'speed': 'medium'}
{'color': 'yellow', 'points': 10, 'speed': 'medium'}
{'color': 'yellow', 'points': 10, 'speed': 'medium'}
总共创建了30个外星人
[{'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}, {'color': 'yellow', 'points': 10, 'speed': 'medium'}]
>>> |
|