I'm really new to coding and Python and have beent trying the "rock, paper, scissor" game. Everything seems to work except the looping and i'm really struggling to understand why, I thought that setting the player to False would reloop the code?
from random import randint
t = ["rock", "paper", "scissors"]
computer = t[randint(0, 2)]
player = False
while player == False:
player = input("rock, paper or scissors?")
if player == computer:
print("Tie!")
elif player == "rock":
if computer == "paper":
print ("sorry, you lose!", computer, "beats", player)
else:
print("Great, you win!", player, "destroys", computer)
elif player == "paper":
if computer == "scissors":
print("sorry, you lose", computer, "beats", player)
else:
print("Great, you win!", player, "destroys", computer)
elif player == "scissors":
if computer == "rock":
print("sorry, you lose!", computer, "beats", player)
else:
print("Great, you win!", player, "destorys", computer)
else:
print("not a valid input, try again")
player = False
computer = t[randint(0, 2)]
Any help is welcome!