'I'm trying to get every combination of color and value and I don't know how to use the function islice
from itertools import islice
colur={"S", "H", "D", "C"}
val={"2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"}
for c in islice(colur,0,4):
for v in islice(val,0,13):
print( c,v )
I want it to print S2 S3 S4 S5 S6 S7 S8 ....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
