0

How do I get my game to loop repeatedly in Python?

from random import randint options = ['rock', 'paper', 'scissors'] player1 = options[randint(0,2)] player2 = False while player2 == False: player2 = input("rock, paper, scissors?") if (player1 == 'rock' and player2 == 'scissors'): print 'player 1 wins.' if player1 == 'paper' and\ player2 == 'rock': print 'player 1 wins' if player1 == 'paper' and\ player2 == 'paper': print 'players tie' if player1 == 'rock' and\ player2 == 'rock': print 'players tie' if player1 == 'scissors' and\ player2 == 'paper': print 'player 1 wins' if player1 == 'scissors' and\ player2 == 'scissors': print 'players tie' if player1 == 'scissors' and\ player2 == 'rock': print 'player 2 wins' if player1 == 'paper' and\ player2 == 'scissors': print 'player 2 wins' if player1 == 'rock' and\ player2 == 'paper': print 'player 2 wins'

21st Jun 2017, 6:11 AM
Iris Eye
Iris Eye - avatar
2 Respostas
+ 1
while True: play_game()
21st Jun 2017, 6:13 AM
Bogdan Sass
Bogdan Sass - avatar
4th Oct 2017, 7:30 PM
sayan chandra
sayan chandra - avatar