I want to create a list of string elements that is a deck of cards.
I created two lists of strings (1-Ace and suites). I want to use nested for loops to do this, and include a word in-between the two (" of "). I did this quickly and easily when printing everything, but when I went to append to another list (deck) I've run into problems creating the string variable that I want.
EDIT: I'm receiving the following error: "inconsistent use of tabs and indentation".
I'm currently using notepad++, but I'd gotten the same error earlier when I was using the IDLE.
nums = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"]
suite = ["Diamonds", "Hearts", "Clubs", "Spades"]
deck = []
for element in nums:
for suit in suite:
card = "%s of %s" % (element, suit)
deck.append(card)
print (deck)
My goal is to have a list of strings similar to this ... ["1 of hearts", "Ace of spades"]...
Thanks!