I am writing a code for school and we need to make a deck of cards as part of it. I have already made the deck but I do not know how to print it the way I want it. It either prints with all the brackets and commas or none. My goal is to print it with a comma separating every two values of the list. Any suggestions?
Asked
Active
Viewed 35 times
0
-
4Show us how you're printing the deck, and the output it makes. – John Gordon May 26 '20 at 14:50
1 Answers
0
Here's way, maybe not the best result:
cards = ['3','A','7','Q','4']
print(f'"{", ".join(cards)}"')
Output:
"3, A, 7, Q, 4"

Red
- 26,798
- 7
- 36
- 58