I have the lines "80010", "80030", "80050" in the list, as in
test = ['80010','80030','80050']
How can I remove the last character (in this case the very last digit of each line that is 0) so that I can end up with another list containing only the first four digits / characters from each line? It so happened something like
newtest = ['8001', '8003', '8005']
I am very new to Python, but I tried with if-else statements, adding using indexing [: -1] etc., but nothing works unless I delete all other zeros. Thank you very much!
source share