# If we have an error - except block fires but else block doesn't
# If we haven't an error - else block fires but except block doesn't
# Finally block executed everytime you are using it
# number = input('Enter some number')
# try:
#     print((number)/2)
# except:
#     print('You have to enter a number')
# else:
#     print('else block')
# finally:
#     print('finally block')

# while True:
#     try:
#         value=int(input('Enter some number'))
#         print(value / 2)
#     except:
#         print('You have to enter a number')
#     else:
#         break
#     finally:
#         print('finally block')

def deviden(x,y):
    try:
        print(x/y)
    except ZeroDivisionError as e:
        print("can't devide by zero")
        print(e)
    except TypeError as e:
        print('it should be a numbers')
        print(e)
    else:
        print('x devided by y')
    finally:
        print('finally block')

print(deviden(4,'ee'))
