loops

 Jeff the Killer · November 4, 2015 print("play rock paper scissors.")rock="rock"paper="paper"scissor="scissor"human= input()if human==rock:   human=rock   print("You chose " + rock)elif human==paper:    human=paper    print("You chose " + paper)elif human==scissor:    human=scissor    print("You chose " + scissor)else: print("invalid choice")   import random   computer_choice=random.randint(1,3)   if computer_choice==1:       computer_choice="rock"   elif computer_choice==2:       computer_choice="paper"   elif computer_choice==3:       computer_choice="scissor"   if computer_choice=="rock" and human=="rock":          print("tie")   elif computer_choice=="rock" and human=="paper":          print("you win")   elif computer_choice=="rock" and human=="scissors":          print("you lose")             elif computer_choice=="paper" and human=="paper":          print ("tie")   elif computer_choice=="paper" and human=="rock":          print ("you lose")   elif computer_choice=="paper" and human=="scissor":          print ("you win")             elif computer_choice=="scissor" and human=="paper":         print ("you lose")   elif computer_choice=="scissor" and human=="rock":         print ("you win")   elif computer_choice=="scissor" and human=="scissor":         print ("tie")   elif computer_choice=="scissor" and human=="paper":          print ("you lose")   elif computer_choice=="scissor" and human=="rock":          print ("you win")   elif computer_choice=="scissor" and human=="scissor":          print ("tie")   print(computer_choice)#I want to loop the game to keep on repeating every time computer_choice gives an answer. how to do it? P#PS is there a way on how to exclude a function like make it not work

Replies

 Balaskandan Giri · November 4, 2015 include while(1): Jeff the Killer · November 5, 2015 thanks for the tip
• 1

Python

129,771 followers