Answers for "python combine nested for loops"

0

python combine nested for loops

from itertools import product
dice_sides = [1, 2, 3, 4, 5, 6]
coin_sides = ['Heads', 'Tails']

for die,coin in product(dice_sides, coin_sides):
    print(die,coin)
Posted by: Guest on October-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language