I tried writing this code for rock paper scissors but it says “sorry, invalid response” no matter what i enter. HELP
try:
import random
def main():
comp=random.randint(0,2)
user=input("enter either\"rock\" \"paper\" or \"scissors\" : ").lower()
rock=1
paper=0
scissors=2
if (comp == 1 and user == 0) or (comp == 2 and user==1) or (comp==0 and user ==2):
print ("YOU WON")
elif (user is not True ) and (user is not False) and (not user == 2):
print ("Sorry, invalid response")
main()
else:
print ("Sorry, you lost")
restart=input ("enter yes if u want to play again: ").lower()
if restart == ("yes"):
main()
else:
quit()
except:
print ("something went wrong")
main()