def divide (a, b):
    try:
        print (f'Attempting {a}/{b}')
        return a / b
    except ZeroDivisionError as zeroDivisionError:
        print ('Division through 0 is prohibited')
        print (zeroDivisionError)
        return float ('nan')
    else:
        print (f'Division through {b} is allowed')
    finally:
        print (f'Attempted {a}/{b}')

print (divide (4, 2))
print ()

print (divide (2, 0))
print ()

print (divide (1, 0.5))
print ()