知行编程网知行编程网  2022-11-09 15:30 知行编程网 隐藏边栏  5 
文章评分 0 次,平均分 0.0
导语: 本文主要介绍了关于Python3.1中的特性有哪些的相关知识,包括服务质量特性中最主要的是,以及简述水对非水箱中酶的特性有何影响这些编程知识,希望对大家有参考作用。

Python 3.1 有哪些功能


1、千位数格式化,

可以在使用字符串格式化函数时直接完成。

格式化大数字时,通常每隔三位放置逗号以使数字更易于阅读(例如,1,048,576 比 1048576 更易于阅读)。

"2 to the 20th power is {:,d}".format(2**20)
'2 to the 20th power is 1,048,576'


2、collections.Counter类是collections的一部分。

是 Python 中的秘密超级武器。它通常首先在 Python 面试问题的简单答案中遇到,但它的价值并不止于此。

hd_song = """
In winter, when the fields are white,
I sing this song for your delight.
 
In Spring, when woods are getting green,
I'll try and tell you what I mean.
 
In Summer, when the days are long,
Perhaps you'll understand the song.
 
In Autumn, when the leaves are brown,
Take pen and ink, and write it down.
"""


3、执行软件包中的 __main__ 模块。

从 Python 3.1 开始,python -m package 将执行包中的 __main__ 模块。这是放置调试脚本或命令的好地方,这些脚本或命令主要使用工具执行并且不需要很短。


本文教程操作环境:windows7系统、Python 3.1,DELL G3电脑。

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

知行编程网
知行编程网 关注:1    粉丝:1
这个人很懒,什么都没写
扫一扫二维码分享