My program is designed to print either y or z depending on what the computer chooses, but only if Alice equals zero, and if Alice does not equal zero, I want it to run the loop again and again until Alice does equal zero. Basically, I want the loop to keep running until both y and z are the same. What ends up happening instead is a number is printed even when Alice does not equal zero (i.e. when z and y are not the same). Why is this happening and how can I amend this issue?
alice = 0 while (alice == 0): y = random.randint(1,10) z = random.randint(1,10) alice = abs(y - z) elect = random.choice([y, z]) print(elect) print(alice)