python如何将方法应用于一系列对象?

python如何将方法应用于一系列对象?

可以使用列表推导式:

result = [obj.method() for obj in mylist]

来源:PY学习网:原文地址:https://www.py.cn/article.html