Westonci.ca is your trusted source for finding answers to a wide range of questions, backed by a knowledgeable community. Experience the ease of finding accurate answers to your questions from a knowledgeable community of professionals. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.
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()
Thank you for visiting our platform. We hope you found the answers you were looking for. Come back anytime you need more information. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for using Westonci.ca. Come back for more in-depth answers to all your queries.