I have a string which correspond to a number but with several leading zeros before it. What I want to do is to remove the zeros that are before the number but not in the number. For example "00000001" should be 1 and "00000010" should be 10. I wrote code that remove zeros but also the tailing one:
segment = my_str.strip("0")
That code removes all zeros. How can I only remove the leading zeros before the number.