SyntaxFix
Write A Post
Hire A Developer
Questions
deck = [] for rank in ranks: for suit in suits: deck.append(('%s%s')%(rank, suit))
This can be achieved using list comprehension:
[deck.append((rank,suit)) for suit in suits for rank in ranks ]