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.
基本上,我想要一些类似的东西:
for coin in all_coins["result"] and coin2 in all_coins2["result"]: specifiedlist.append(Crypto(coin, coin2))
任何帮助我指出正确的功能或格式的方向将不胜感激。
您可以使用itertools.product在列表理解中创建排列
itertools.product
from itertools import product specifiedlist = [Crypto(coin, coin2) in product(all_coins["result"], all_coins2["result"])]