Westonci.ca offers quick and accurate answers to your questions. Join our community and get the insights you need today. Connect with a community of experts ready to provide precise solutions to your questions quickly and accurately. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.
Sagot :
Answer:
def dice_roller():
# ask for first input
input1 = int(input("Enter the first roll: "))
# check if it's valid
while input1 < 1 or input1 > 6:
print("Invalid number")
# ask for new input if the previous was invalid
input1 = int(input("Enter the first roll: "))
# ask for second input
input2 = int(input("Enter the second roll: "))
# check if it's valid
while input2 < 1 or input2 > 6:
print("Invalid number")
# ask for new input if the previous was invalid
input2 = int(input("Enter the second roll: "))
# check of the numbers are the same
if input1 == input2:
print("You rolled the same numbers. Try again")
# if they are the same call this function again to get new numbers
dice_roller()
else:
# print how many spaces to advance
print("Advance", input1+input2, "spaces")
if __name__ == '__main__':
dice_roller()
We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Thank you for choosing Westonci.ca as your information source. We look forward to your next visit.