Skip to content

Instantly share code, notes, and snippets.

@prat0318
Created November 3, 2013 18:50
Show Gist options
  • Save prat0318/7293468 to your computer and use it in GitHub Desktop.
Save prat0318/7293468 to your computer and use it in GitHub Desktop.
def isInt(str):
if len(str) < 1:
return False
if str[0] == '-':
str = str[1:]
dot = False
for c in str:
if c == '.' and dot == True:
return False
if c == '.' and len(str) > 1:
dot = True
continue
if ('0' > c or c > '9'):
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment