I'm just trying to do some looping functions in Python, however I am pretty much stuck here.
I don't know if it should be a nested or simultaneous loop, and if so, how to use it probably.
Python is telling me (ValueError: too many values to unpack)
Here is my code:
rows = 16
for i in range(rows):
for a,b,c,d,e,f,g,h,j in range(1, 17), range(18, 34), range(35, 40), range(41, 57), range(58, 74), range(75, 91), range(92, 108), range(109, 125), range(126, 127):
print '{0:4d} {1:4d} {2:4d} {3:4d} {4:4d} {5:4d} {6:4d} {7:4d}'.format(a, b, c, d, e, f, g, h, j)
I basicly want the application to print out the range of numbers from 1 to 128 in this layout over 16 rows with the numbers going horisontal:
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
122 122 122 122 122 122 122 122
123 123 123 123 123 123 123 123
124 124 124 124 124 124 124 124
125 125 125 125 125 125 125 125
126 126 126 126 126 126 126 126
127 127 127 127 127 127 127 127
128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128
124 124 124 124 124 124 124 124
125 125 125 125 125 125 125 125
126 126 126 126 126 126 126 126
127 127 127 127 127 127 127 127
128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128