I'm fairly new to Python and having a hard time figuring out how to print a list in rows given these circumstances:
The list starts out empty and the computer generates random 2-digit integer entries, which are then appended to the list. Printing the list is easy enough, either in a single column or in a single line using
for i in list:
print(i, end = "")
but what I want to do is print in rows of 4, ending the list with whatever the remainder is (e.g. a row of 3), so that the outcome would look something like this:
81 27 19 55
99 45 32 90
67 83 20 72
12 86 21
What is the best and most straightforward way to do this?
Edit: I forgot to clarify that I'm working in Python 3. Sorry about that.