import time

def add(y1,y2):
    return y1+y2

def sub(y1,y2):
    return y1-y2

def mul(y1,y2):
    return y1 * y2

def div(y1,y2):
    i=0
    while y2 == 0:
        print('Durch Null dividieren ist nicht definiert')
        print('Bitte Zahl 2 eingeben:')
        y2 = input()
        if bool(y2) == False:
            while True:
                loadingbar()            
    return y1 / float(y2)

def loadingbar():
    while (True):
        print("Exiting...")
        print("Loading...")
        time.sleep(0.5)
        print("[                    ]  0%")
        time.sleep(0.5)
        print("[=====               ] 25%")
        time.sleep(0.5)
        print("[==========          ] 50%")
        time.sleep(0.5)
        print("[===============     ] 75%")
        time.sleep(0.5)
        print("[====================] 100%")
        time.sleep(0.5)
        print("ERROR 288")


def fak(y1):
    if y1 == 0:
        return 1
    else:
        return y1 * fak(y1-1)


while True:
    try:
        y1 = float(input('Bitte Zahl 1 angeben:'))
        y2 = float(input('Bitte Zahl 2 angeben:'))
        break
    except ValueError: 
        print("Nochmal veruschen bitte nur Zhalen!")


print("Bitte waehlen Sie eine Operation:")
print(" Addieren (+)")
print(" Subtrahieren (-)")
print(" Multiplizieren (*)")
print(" Dividieren (/)")
print("Fakultaet (!)")
op = input()

if op == "+":
    print(add(y1,y2))
elif op == "-":
    print(sub(y1,y2))
elif op == "*":
    print(mul(y1,y2))
elif op == "/":
       print(div(y1,y2))
elif op == "!":
       print(fak(y1))
else:
    print('Eingabe ungueltig')




# while (True):
#       print("Exiting...")
#       print("Loading...")
#       time.sleep(0.5)
#       print("[                    ]  0%")
#       time.sleep(0.5)
#       print("[=====               ] 25%")
#       time.sleep(0.5)
#       print("[==========          ] 50%")
#       time.sleep(0.5)
#       print("[===============     ] 75%")
#       time.sleep(0.5)
#       print("[====================] 100%")
#       time.sleep(0.5)
#       print("ERROR 288")