Blackjack Game - displaying ASCII Graphics / Multiline Strings
<p>I'm pretty new to Python and currently trying to create a basic blackjack game using ASCII graphics to represent the cards. I've placed the card images in a list of multiline strings and the idea is to call the specific index for each one when a card needs to be displayed. </p>

<p>However I can't get them to print next to each other, and no amount of tinkering seems to get it to work. Here's the code: </p>

<pre><code>CARDS = ['''
 -------
|K      |
|       |
|       |
|       |
|      K|
 ------- ''', '''
 -------
|Q      |
|       |
|       |
|       |
|      Q|
 ------- ''', ''' 
 -------
|J      |
|       |
|       |
|       |
|      J|
 ------- ''', '''
 -------
|10     |
|       |
|       |
|       |
|     10|
 ------- ''', '''
 -------
|9      |
|       |
|       |
|       |
|      9|
 ------- ''', '''
 -------
|8      |
|       |
|       |
|       |
|      8|
 ------- ''', '''
 -------
|7      |
|       |
|       |
|       |
|      7|
 ------- ''', '''
 -------
|6      |
|       |
|       |
|       |
|      6|
 ------- ''', '''
 -------
|5      |
|       |
|       |
|       |
|      5|
 ------- ''', '''
 -------
|6      |
|       |
|       |
|       |
|      6|
 ------- ''', '''
 -------
|5      |
|       |
|       |
|       |
|      5|
 ------- ''', '''
 -------
|4      |
|       |
|       |
|       |
|      4|
 ------- ''', '''
 -------
|3      |
|       |
|       |
|       |
|      3|
 ------- ''', '''
 -------
|2      |
|       |
|       |
|       |
|      2|
 ------- ''', ''' 
 -------
|A      |
|       |
|       |
|       |
|      A|
 ------- '''
]

BLANKCARD = '''
 -------
|XXXXXXX|
|XXXXXXX|
|XXXXXXX|
|XXXXXXX|
|XXXXXXX|
 ------- '''


def displayCards():
    print(CARDS[2] + CARDS[14], end='')

displayCards()
</code></pre>

<p>The above code prints the following:</p>

<pre><code> -------
|J      |
|       |
|       |
|       |
|      J|
 ------- 
 -------
|A      |
|       |
|       |
|       |
|      A|
 ------- 
</code></pre>

<p>I've tried using end='' to get rid of the new line, but no joy. Does anyone have any suggestions about how I can get the cards next to each other?</p>

<p>Thanks in advance!</p>

<p>I suggest you write a function that, given i and n, returns a string which represents line i of card n. You can then call that in a double nested loop, printing the results in sequence, to get the result you need. 
You can start by making an example of the output you want to see, to use as a reference while coding the loop.</p>

python python-3.x