x = 0
y = 0
z = 0
possibleValues = [0, 10, 11, 20, 21, 22]
def checkvalid(a):
while possibleValues.count(a) != 1:
a = int(input("That value doesn't seem quite right. Please enter a different value \n"))
return a
def convert(b):
if b < 10:
conv = str(("0" + str(b)))
else:
conv = str(b)
return conv
while True:
x = int(input("X=? \n"))
x = checkvalid(x)
y = int(input("Y=? \n"))
y = checkvalid(y)
z = int(input("Z=? \n"))
z = checkvalid(z)
first = abs((2*x)+11)
second = abs((2*z+y)-5)
third = abs((y+z)-x)
code = (str(first)+" "+convert(second)+" "+convert(third))
print("Code:", code)
d = input("Press any key to start again")