I was stripping a file name in python for routing purposes and I was getting some unexpected behavior with the python strip function. I've read the docs and searched online but have not been able to find an explanation for the following behavior:
"Getting-Started.md".strip('.md')
Out[29]: 'Getting-Starte'
But if it is any other character aside from 'd' to the left of the period, it works properly:
"Getting-StarteX.md".strip('.md')
Out[30]: 'Getting-StarteX'
It seems like there is something similar to a mirroring going on 'd. md'. I'm doing a double strip to get by this for now, but I was just curious of why this occurs.
Thank you.