Здравствуйте, это я снова спрашиваю о своем коде. Я создаю Rock, Paper, Scissor, добавляю main()
и def main():
и делаю отступ, но когда я запускаю код, это происходит
C:\Users\Timothy\Documents>python text.py
C:\Users\Timothy\Documents>
это мой код
def main():
import random
print("1=Rock, 2=Paper, 3=Scissor")
player = int(input("Please Put your choice"))
ai = random.randint(1,3)
###if and else statement for ai to print the random integer to string
if (ai == 3):
print("AI: Scissor")
elif (ai == 2):
print("AI: Paper")
elif (ai == 1):
print("AI: Rock")
####if and statement for the ai and player
if (player == ai):
print("It is a tie")
if (player == 1 and ai == 2):
print("AI won")
if (player == 1 and ai == 3):
print("You Won!!")
if (player == 2 and ai == 1):
print("You won")
if (player == 2 and ai == 3):
print("AI won")
if (player == 3 and ai == 1):
print("AI won")
if (player == 3 and ai == 2):
print("You won")
main()