[Tutor] (no subject)

john public apython101@yahoo.com
Tue, 4 Dec 2001 15:23:16 -0800 (PST)

```I am a beginning programmer. Here is my my first
program for tic tac toe. It works BUT, a simple loop
would shorten this code considerably.  Is there a way
to tell the program to go to the line:

n = input("which sqaure")

once it gets to the end of the first cycle?

Thanks!!

a,b,c,d,e,f,g,h,i =1,2,3,4,5,6,7,8,9

square = ['a','b','c','d','e','f','g','h','i']

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square
# end of first part, can we loop here?
# can we create functions and modules to shorten the
code?
n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

n = input("which square?")

s = raw_input("who gets the square?")
square[n-1] = s

print square,square,square
print square,square,square
print square,square,square

__________________________________________________
Do You Yahoo!?