{}
run-icon
main.py
xSymb = 0 ySymb = 0 zSymb = 0 x = 0 y = 0 z = 0 def convsymbol(c): valid = False while not valid: if c == 1: value = 0 valid = True elif c == 2: value = 11 valid = True elif c == 3: value = 10 valid = True elif c == 4: value = 22 valid = True elif c == 5: value = 21 valid = True elif c == 6: value = 20 valid = True else: c = int(input("That is not a valid symbol. Enter a number from 1 to 6")) return value def convert(b): if b < 10: conv = str(("0" + str(b))) else: conv = str(b) return conv while True: xSymb = int(input("Enter the symbol for x")) x = convsymbol(xSymb) ySymb = int(input("Enter the symbol for y")) y = convsymbol(ySymb) zSymb = int(input("Enter the symbol for z")) z = convsymbol(zSymb) 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) input("Press any key to start again")
Output