摘要: 转自 https://www.2cto.com/kf/201312/268555.html 1.判断、循环 对于Python的循环及判断主要包括这些关键字: if elif else for while break continue and or is not in 1.1 if 语法 if语法与C 阅读全文
posted @ 2017-09-14 16:47 青争Fighting! 阅读(403) 评论(0) 推荐(0)
摘要: 1. 将浮点数四舍五入:round(1.7333) 2. 格式化字符:%s %d %r %r和%s有什么不同? %r用来做debug比较好,因为它会显示变量的原始数据(raw data),而 其它的符号则是用来向用户显示输出的。记住:%r用作debug,%s用作显示。 使用了%r后转义序列都不灵了。 阅读全文
posted @ 2017-09-11 18:24 青争Fighting! 阅读(3081) 评论(0) 推荐(0)