Skip to content

Python code snippet – pyton How to tell if string is a int or string?

def RepresentsInt(s):
    try: 
        int(s)
        return True
    except ValueError:
        return False
See also  CSS code snippet - How to scroll fixed position?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.