Skip to content

Instantly share code, notes, and snippets.

@brettfreer
Created June 20, 2016 22:09
Show Gist options
  • Save brettfreer/8a4a6a19d6d78cd301c150705215f55b to your computer and use it in GitHub Desktop.
Save brettfreer/8a4a6a19d6d78cd301c150705215f55b to your computer and use it in GitHub Desktop.
Remove leading zeros from a string
def remove_leading_zeros(s):
while s[0] == '0':
s = s[1:]
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment