0

i am trying to make this go back to the condition 'start' if wrong data is put in (any number less than or equal to 2 for Dice and 1 for sides to go back to ask to be able to reenter the number of sides and dice

condition = "Start" 
while condition == "Start": 
Dice = int(input("Please select number of dice you would like to use between 1 and 5")) 
Sides = int(input("Please select number of sides on dice you would like to use")) 
if (Dice >= 2 and Sides >= 1):
    condition = "Start"
else: 
#... rest of code here
  • Perhaps I closed this too quickly. Your code actually looks fine, so what's the problem? – zondo Apr 30 '17 at 22:10
  • when i run this code and incorrect variables have been put in it is not always bug free, when "1" is typed in to both it will go back to the condition "start" but when "0" is typed it will have an error or continue – Carlos Omeck Apr 30 '17 at 22:13
  • 1
    I don't get any errors unless I enter a non-integer. Would you mind adding enough of the `else` that it can be reproduced? (Please see [mcve]) – zondo Apr 30 '17 at 22:23

0 Answers0