python
dijiaye1
这个作者很懒,什么都没留下…
展开
-
python格式化格式化输出
一、占位符1、输出整数(%d)str1 = "the length of the word is %d" %(16)print(str1)输出结果:"the length of the word is 16"2、输出浮点数str1 = "the length of the word is %f" %(16.5)print(str1)输出结果:"the length of the word is 16.500000"#保留两位小数str1 = "the length of原创 2021-03-31 17:05:01 · 238 阅读 · 0 评论 -
Python关键字一览表
关键字是Python语言中一些已经被赋予特定意义的单词,这就要求开发者在开发程序时,不能用这些关键字作为标识符给变量、函数、类、模板以及其他对象命名。Python 包含的保留字可以执行如下命令进行查看:>>> import keyword>>> keyword.kwlist['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def'...原创 2020-06-24 17:44:02 · 1483 阅读 · 0 评论 -
Python标识符命名规范
1、标识符是由字符(A~Z 和 a~z)、下划线和数字组成,但第一个字符不能是数字;2、标识符不能和 Python 中的关键字相同;3、Python中的标识符中,不能包含空格、@、% 以及 $ 等特殊字符;eg:下面所列举的标识符是合法的: UserID name ...原创 2020-06-24 17:05:37 · 8361 阅读 · 0 评论 -
python基础知识-编译型语言和解释型语言的区别
前提概要 开发人员编写的是源代码是人类语言,我们可以理解。但是对于计算机硬件(CPU),源代码无法理解,根本执行不了。在程序真正的运行之前必须翻译 2020-06-11 18:36:16 · 719 阅读 · 0 评论