I have variable passed in which can be a string or integer passed in. For example it can be '123' or 123. Additionally, it could be a string like 'N/A', and in this case I want to replace it with 0.
I have been trying to do something like this:
our_value = int(our_value) if our_value.isdigit() else 0
The issue is when our_value is an integer it has no method isdigit. If it's a string this will work fine.
How can I handle both cases where it can be a integer or string?