gll89的个人博客分享 http://blog.sciencenet.cn/u/gll89

博文

Python--sort numeric string

已有 1685 次阅读 2017-12-13 08:33 |个人分类:Python|系统分类:科研笔记

If a list of numbers are stored in strings, please note that they are sorted as ASCAII.

For example:


>>>aa = ['1101', '201', '111']

>>>aa.sort()

>>>print aa


The result is ['1101', '111', '201']




https://blog.sciencenet.cn/blog-1969089-1089412.html

上一篇:Python--Super usage
下一篇:Latex frequently used command lines
收藏 IP: 128.227.115.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-20 11:12

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部