Reputation: 21
I am trying 2 different codes on how to print the first 13 cards but i can't seem to know how.
I need to print only the first 13 cards here but idk how to.
This another code, I am confused on list slicing and how to remove the '' between them
I was able to print the first 13 cards but I am confused why it is [1:91] if I already put "" per string? And I dont know how to remove the '' between strings and spaces before the parenthesis.
I have to print the first 13 cards (which were C) but I dont know how
Upvotes: 0
Views: 92
Reputation: 89
Please do not use images to upload text.
houses = ['C', 'D', 'H', 'S']
ranks = ['A', '2', '3' ... 'Q', 'K']
deck = []
for house in houses:
for rank in ranks:
deck.append(f"{rank}-{house}")
for i in range(13):
print(deck[i])
Upvotes: 1