Discover a wealth of knowledge at Westonci.ca, where experts provide answers to your most pressing questions. Discover solutions to your questions from experienced professionals across multiple fields on our comprehensive Q&A platform. 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()
We hope this information was helpful. Feel free to return anytime for more answers to your questions and concerns. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Westonci.ca is committed to providing accurate answers. Come back soon for more trustworthy information.