How can I use format() to print out a table like the one in the expected output? I tried and got an error:
unsupported format string passed to list.__format__
data = [[1, [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]],
[2, [1, 2, -999, 4, 5], [1, 2, 3.0, 4, 5]]]
print ("{:<10} {:<20} {:<20}".format('Test Case','Original','Clean-Up'))
for item in data:
testcase, original, clean = item
print ("{:<10} {:<50} {:<50}".format(testcase, original, clean))
Expected output:
test case original clean-up
1 1, 2, 3, 4, 5 1, 2, 3, 4, 5
2 1, 2, -999, 4, 5 1, 2, 3.0, 4, 5