-3

Basically, I want something along the lines of:

for coin in all_coins["result"] and coin2 in all_coins2["result"]:
    specifiedlist.append(Crypto(coin, coin2)) 

Any help pointing me into the direction of a proper function or formatting would be appreciated.

Deadmon
  • 49
  • 7

1 Answers1

1

You can use itertools.product to create your permutations in a list comprehension

from itertools import product
specifiedlist = [Crypto(coin, coin2) in product(all_coins["result"], all_coins2["result"])]
Cory Kramer
  • 114,268
  • 16
  • 167
  • 218