python L6 worksheet 1
python L6 worksheet 1
def vacuum():
print("Vacuuming the floor...")
def make_bed():
print("Making the bed...")
wash_up()
vacuum()
make_bed()
def drawGrid():
print("---------")
print("| |")
print("| 1 |")
print("| |")
print("---------")
print("| |")
print("| 2 |")
print("| |")
print("---------")
print("| |")
print("| 3 |")
print("| |")
print("---------")
def playerChooses():
print("Choose a square (1-9): ")
playerChoice = input()
print("Player chose:", playerChoice)
def checkIfSomeoneWon():
print("Checking if someone won...")
def computerChooses():
print("Computer choosing a square...")
# Check columns
for col in range(3):
if board[0][col] == board[1][col] == board[2][col] and board[0][col] != " ":
print(f"{board[0][col]} wins!")
return True
# Check diagonals
if (board[0][0] == board[1][1] == board[2][2] and board[0][0] != " ") or \
(board[0][2] == board[1][1] == board[2][0] and board[0][2] != " "):
print(f"{board[1][1]} wins!")
return True
return False