How to check if a string is an integer in python
Often it is required to convert a string to an integer but before conversion it is recommended to check if the string being converted is in integer format or not. This might be useful when converting a user input value into an integer since user entered value will always be a string. If the string is not integer then the conversion process will fail resulting in code break. This is because it is possible to convert “12” into 12 but trying to convert ‘twelve’ into a integer will result in an error. This post shall list down different methods by which we can check aRead More →