Created
June 20, 2016 22:09
-
-
Save brettfreer/8a4a6a19d6d78cd301c150705215f55b to your computer and use it in GitHub Desktop.
Remove leading zeros from a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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