Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个代码
keys = {'speed','temp'}
我有像这样的变量
object.subobj.speed和object.subobj.temp
object.subobj.speed
object.subobj.temp
我怎么能循环
for key in keys print object.subobj.key
for key in keys: print getattr(obj.subobj, key)