会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
flyme2moon
博客园
首页
新随笔
联系
订阅
管理
2020年1月8日
2020-1-8
摘要: >>> numb=list(range(1,6))>>> print(numb)[1, 2, 3, 4, 5] >>> digits=list(range(1,6))>>> min(digits)1>>> max(digits)5>>> sum(digits)15 >>> squares = lis
阅读全文
posted @ 2020-01-08 17:55 flyme2moon
阅读(127)
评论(0)
推荐(0)
2020年1月7日
2020-1-7
摘要: >>> string=' python '>>> string' python '>>> string.rstrip()' python' >>> string.rstrip()' python'>>> string.strip()'python'>>> string.lstrip()'python
阅读全文
posted @ 2020-01-07 14:19 flyme2moon
阅读(108)
评论(0)
推荐(0)
2019年12月12日
format { }
摘要: 首先说一下format函数,用{}和:代替了%,比如: >>>“{} {} {}”.format("I","LOVE","STUDY") >>>'I LOVE STUDY'>>>"{0} {1} {0}".format("hi","hello")>>>'hi hello hi' 还有: >>>nam
阅读全文
posted @ 2019-12-12 14:03 flyme2moon
阅读(992)
评论(0)
推荐(0)
%s
摘要: 1 string="hello" 2 3 #%s打印时结果是hello 4 print "string=%s" % string # output: string=hello 5 6 #%2s意思是字符串长度为2,当原字符串的长度超过2时,按原长度打印,所以%2s的打印结果还是hello 7 pri
阅读全文
posted @ 2019-12-12 13:59 flyme2moon
阅读(436)
评论(0)
推荐(0)
公告