I'm trying to compare strings in Python that can be different lengths. This is to do a simple version check.
Here are the examples: 1.2.3, 1.2.15, 1.2.2a
I need to compare to find which one is bigger so taking example above 1.2.2a < 1.2.3 < 1.2.15
. If there were only number than it would be pretty simple but the added character messes things as it is not always present. I thought that converting to base64 which makes string the same length will solve the problem but with base64 1.2.15 becomes less than 1.2.2a and 1.2.3.
Maybe there is a module that already does that.
Thank you.