[Tutor] another for loop question - latin square
Brandon Merritt
merrittb7 at gmail.com
Mon Dec 31 00:59:14 CET 2012
I am having trouble figuring out a solution after a couple hours now of
playing with the code. I'm trying to make a latin square using the code
below:
scaleorder = int(raw_input('Please enter a number for an n*n square: '))
topleft = int(raw_input('Please enter the top left number for the square:
'))
firstrow = range((topleft),scaleorder+1)
count = 0
while count < 8:
for i in firstrow:
print i
count += 1
firstrow[i+1]
-----------------------------------------------------------------------
It seemed like I could make the for loop work by doing something like this:
for i in firstrow:
print i, i+2
but that obviously is not a solution either. Any ideas?
Thanks,
Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121230/0d206b45/attachment.html>
More information about the Tutor
mailing list