摘要: 学习自:https://coolshell.cn/articles/2514.html 题目:“如果有三个Bool型变量,请写出一程序得知其中有2个以上变量的值是true” 方法一 方法一改进版 方法二 阅读全文
posted @ 2018-01-13 21:22 lixin[at]hitwh 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 带关键字的格式化 >>> >>> print "Hello %(name)s !" % {'name':'James'} Hello James ! >>> >>> print "Hello {name} !".format(name="James") Hello James ! >>> 使用dic 阅读全文
posted @ 2018-01-13 16:34 lixin[at]hitwh 阅读(516) 评论(0) 推荐(0) 编辑