I have created a while loop in which numbers are being generated, but I'm unable to make the loop continue when ever I add an user input command - which is the opposite of what I want. I want the loop to either continue or stop depending on what the user inputs. Someone please kindly help me out!
import random as r
lowest = 1
highest = 12
roll_counter = 0
roll = 'yes'
dont_roll = False
while roll == 'yes' or 'y':
print(roll_counter)
print('Rolling...')
print('...the dice came out as', r.randint(lowest, highest), '-', r.randint(lowest, highest), '&', r.randint(lowest, highest), '-', r.randint(lowest, highest))
roll_counter += 1
if roll(input('Reroll? ')) == 'yes' or 'y':
continue
else:
print('end')
break
#This the hoped-for result (as viewed by user)
0 # I want the user to know how many rolls have taken place
Rolling...
...the dice came out as #number - #number & #number - #number
Reroll? yes #or y (for yes)
1
Rolling...
...the dice came out as #number - #number & #number - #number
Reroll? #any input other than 'yes' or 'y' would end the loop
End