In Python 3 I'm trying to unpack a list of lists:
members = [['3', '5', '5', '20', 'D'], ['2', '2', '2', '30', 'C']]
I want it to print in the format of
3 5 5 20 D
2 2 2 30 C
I've tried using print (' '.join(members)),
but I keep getting the error:
TypeError: sequence item 0: expected str instance, list found
members = [['3', '5', '5', '20', 'D'], ['2', '2', '2', '30', 'C']]
for item in members:
print ' '.join(item)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With