Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

python

OpenStudy (e.mccormick):

How far did you get with the code and where did you get stuck?

OpenStudy (anonymous):

Here's the solution for size 6x6: #loop over 6 lines for i in range(6): #loop over 6 rows for j in range(6): #print the desired number and don't ad a new line print((i+j)%6 +1, end="") #print a new line after we filled a line print() I tested this in python 3.2 and the output is as you explained. To change the the length you can just change the 6 to whatever you want. To change the starting value change this "(i+j)%6 +1" to (i+j+startingValue)%6 +1.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!