Ask a player if they want to play the game.
While the answer is “yes” generate a random number between 1 and 6 (to simulate rolling a dice).
If the number is a 6, display “You rolled a 6, game over” and ask the player if they want to play again.
If the number is not equal to 6, display the number.
When the player no longer wants to play the game, display “Thank you for playing!”
anyone able to help me code this or tell me where i've gone wrong, i'm really confused i've tried to code it but it hasn't worked; this is my code:
import random
dice = random.randint(1, 6)
"roll" == input("Would you like to play?\n")
if "roll" == "Yes".lower():
print(random.randint(1,6))
again = input("Play again?")
if again == "Yes".lower():
print(random.randint(1,6))
if again == "No".lower():
print("Thanks for playing!")
while random.randint(1,6) == 6:
again = input("You rolled a 6, game over! Play again?")
if again == "Yes".lower():
continue
if again == "No".lower():
print("Thanks for playing!")