Using random module and creating functions to roll dice in a craps simulation, every time I run the code it end's up just printing the first win statement. Any suggestions?
import random
print('Craps: A Popular Dice Game')
roll = ''
def rolldie(roll):
print()
enter = input('Press <Enter> to roll the dice.')
if enter == "":
point = "first"
die1 = random.randint(1,6)
die2 = random.randint(1,6)
roll = die1 + die2
print(die1, die2)
print(f'\nYou rolled a {roll} on your {point} roll.')
point = "second"
return roll
def main():
rolldie(roll)
if roll == 7 or 11:
print('\nYou win! 1')
elif roll == 2 or 3 or 12:
print('\nYou lose! 2')
else:
print("\nThat's your point. Roll it again before you roll a 7 and lose!")
rolldie(roll)
if roll == 7 or 2 or 3 or 12:
print('\nYou lose! 3')
else:
print('\nYou win! 4')
main()