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
  • 37,241
  • 25
  • 195
  • 267
DwightD
  • 157
  • 8

2 Answers2

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

Output:

1   2
2   3
Transhuman
  • 3,527
  • 1
  • 9
  • 15
1

You can use string formatting:

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

Output:

1   2
2   3
Ajax1234
  • 69,937
  • 8
  • 61
  • 102