diff --git a/examples/quantum_die.py b/examples/quantum_die.py index c2f3b8a0a..ab892481e 100755 --- a/examples/quantum_die.py +++ b/examples/quantum_die.py @@ -76,4 +76,6 @@ def roll_die(qvm, number_of_sides): if __name__ == '__main__': number_of_sides = int(input("Please enter number of sides: ")) qvm = get_qvm(number_of_sides) - print(f"The result is: {roll_die(qvm, number_of_sides)}") + die_value = roll_die(qvm, number_of_sides) + while die_value > number_of_sides: die_value = roll_die(qvm, number_of_sides) + print(f"The result is: {die_value}") \ No newline at end of file