Jan-19-2017, 12:53 AM
I have looked and read about unpacking tuples, and found several examples, but none of the examples refers to printing. I am too much of a beginner to translate those examples into what I need, which micseydel alluded to above: Unpack the tuple, and print all variables using the format hdr62 -- all in one line of code. Here is what I have:
w = 45667.778 x = 56785.55 y = 34529.4568 z = 789612.554 nums = (w, x, y, z) hdr62 = '{:>15} {:>15} {:>15} {:>15}' print(tuple('${:,.0f}'.format(num).rjust(12, ' ') for num in nums))Can someone give me further help? Thanks