I have an array of string-numbers, like:
numbers = ['10', '8', '918', '101010']
When I use sorted(numbers)
, I get them sorted lexicographically, e.g. '8' > '17'
.
How can I iterate over the strings sorted according to the number value?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…