fullgame = {
1: " ",
2: " ",
3: " ",
4: " ",
5: " ",
6: " ",
7: " ",
8: " ",
9: " ",
}
def if_is_equl(a, b, c):
if a == b == c and b != " ":
print(f"game over you {b} win>>>>>>> ")
cont = "x"
for i in fullgame:
print(f"{fullgame[1]} | {fullgame[2]} | {fullgame[3]} ")
print("-------------")
print(f"{fullgame[4]} | {fullgame[5]} | {fullgame[6]} ")
print("-------------")
print(f"{fullgame[7]} | {fullgame[8]} | {fullgame[9]} ")
inp = int(input("Enter number: "))
if inp > 9:
print("the number is beger than a limit 1 to 9 try again .....")
if fullgame[i] == " " and cont != "o":
fullgame.update({inp: cont})
cont = "o"
elif fullgame[i] == " " and cont != "x":
fullgame.update({inp: cont})
cont = "x"
if_is_equl(fullgame[2], fullgame[5], fullgame[8])
if_is_equl(fullgame[1], fullgame[4], fullgame[7])
if_is_equl(fullgame[3], fullgame[6], fullgame[9])
if_is_equl(fullgame[1], fullgame[2], fullgame[3])
if_is_equl(fullgame[4], fullgame[5], fullgame[6])
if_is_equl(fullgame[7], fullgame[8], fullgame[9])
if_is_equl(fullgame[1], fullgame[5], fullgame[9])
if_is_equl(fullgame[3], fullgame[5], fullgame[7])