Closed anshulxyz closed 7 years ago
Q. Why am I using isinstance() here:
isinstance()
output = fixer(base, target, amount) if isinstance(output, float): output = "{} {} = {} {}".format(amount, base, output, target) click.echo(output)
A. Because when the currency is invalid the operation is returning a string.
except KeyError: result = 1.00 if base == target else "KeyError: Invalid curreny" return result
Add newline at the end of the JSON files that are being written. Such as here
Look for a better way to handle Connection Error Exception.
Refactor file_handling.py
file_handling.py
Q. Why am I using
isinstance()
here:A. Because when the currency is invalid the operation is returning a string.
Add newline at the end of the JSON files that are being written. Such as here
Look for a better way to handle Connection Error Exception.
Refactor
file_handling.py