Dec-02-2019, 04:07 PM
(This post was last modified: Dec-02-2019, 04:27 PM by Clunk_Head.)
(Dec-02-2019, 03:42 PM)ichabod801 Wrote: No, in this case you would use itertools.product, as in print([str(value) + suit for value, suit in itertools.product(values, suits)])
.
It can be made even simpler:
[f'{v}{s}' for v,s in itertools.product(values, suits)]but is there a way to do it without creating an iterable and then iterating though it to create the string?