your getRate method returns zero when you define rate_Nok_Eur = getRate('NOK', 'EUR')
, so amount_nok / rate_Nok_Eur
will gave you the error,
you need to specify the case when you have getRate('NOK', 'EUR')
solved Need help solving “ZeroDivisionError: division by zero”