Python 官方文档note
文章平均质量分 76
虎哥的代码人生
这个作者很懒,什么都没留下…
展开
-
Python Tutorial two
五,输入输出 Str()和rstr()可以将其他类型转换为string类型,用于输出。Rstr()会将值里的转义字符原样输出,而str()会作为转义字符。 String.format()函数类似C中的printf,可以定制输出的格式,后跟格式中需要动态添加的参数: >>> for x in range(1, 11): ... print('{0:2d} {1原创 2017-03-08 17:07:52 · 222 阅读 · 0 评论 -
Python Tutorial one
python注释: #...... python文件编码设置:# -*- coding:utf-8 -*- linux下直接运行py文件:首行加入 #!/usr/bin/env python3 用户输入使用input,打印输出使用print x=int(input("please enter an integer:")) Print(原创 2017-02-25 22:48:11 · 298 阅读 · 0 评论 -
Python Tutorial three
七,Class nonlocal和global关键字 def scope_test(): def do_local(): spam = "local spam" def do_nonlocal(): nonlocal spam #nonlocal 将引用外层已存在变量,但非全局变量 s原创 2017-03-10 10:35:32 · 237 阅读 · 0 评论