Skip to content

Instantly share code, notes, and snippets.

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