0
for i, j in cards: # cards = a list containing list of cards - RANDOM OUTPUTS
        print(i)
        print(j)
        print("\t")

How do I make it so that the output becomes:

TS  6S  JS
AH  5S  AS

Instead of:

TS
AH

6S
5S

JS
AS

EDIT: changes made above - further specified for the type of code I'm writing.

Cœur
  • 34,719
  • 24
  • 185
  • 251
DwightD
  • 157
  • 8

2 Answers2

3
for i, j in lst:
    print (i + '\t' + j)

Output:

1   2
2   3
Transhuman
  • 3,487
  • 1
  • 7
  • 14
1

You can use string formatting:

for i in [['1', '2'], ['2', '3']] :
    print('{}\t{}'.format(*i))

Output:

1   2
2   3
Ajax1234
  • 66,333
  • 7
  • 57
  • 95