How do I make the following work (in Python)?
import random
def roll():
input1 = input("Player1, type 'ROLL' to roll.")
if (input1 == "ROLL"):
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
print("You rolled a " + dice1() + " and a " + dice2() ".")
else:
pass
roll()
I get:
File "main.py", line 9
print("You rolled a " + dice1() + " and a " + dice2() ".")
^
SyntaxError: invalid syntax
I also want it to repeat the "Player1, type 'ROLL' to roll." if the input doesn’t equal ROLL.