Splitting a long tuple into smaller tuples

I have a long tuple like

(2, 2, 10, 10, 344, 344, 45, 43, 2, 2, 10, 10, 12, 8, 2, 10)

and i am trying to split it into a tuple of tuples like

((2, 2, 10, 10), (344, 344, 45, 43), (2, 2, 10, 10), (12, 8, 2, 10))

I am new to python and am not very good with tuples o(2, 2, 10, 10, 344, 344, 45, 43, 2, 2, 10, 10, 12, 8, 2, 10)r lists. My friend said i should split it but i just cant get it -_-

I need to split the tuple into tuples with 4 elements that i will later use a rectangles to draw to a image with PIL.

11
задан Cœur 16 November 2018 в 04:55
поделиться