我需要从有<代码>__str__()方法的班次清单中抽取。
So potions is a list of objects of a class Potion. Potion __str__
method just returns the name of the potion.
I thought of doing something like this
result = "
".join(potions)
但是,只有插手才能加入,一只狗知道如何在加入的每个类别中打上__str__(
)。
或应当这样做:
for potion in potions:
result += "{0}
".format(potion)
也可能是 so?