摘要: #!/usr/bin/python# Filename: str_methods.py name = 'Swaroop' # This is a string object if name.startswith('Swa'): print 'Yes, the string starts with " 阅读全文
posted @ 2017-10-18 21:07 真勇士王小山 阅读(122) 评论(0) 推荐(0) 编辑
摘要: # Filename: reference.py print 'Simple Assignment'shoplist = ['apple', 'mango', 'carrot', 'banana']mylist = shoplist # mylist is just another name poi 阅读全文
posted @ 2017-10-18 21:05 真勇士王小山 阅读(78) 评论(0) 推荐(0) 编辑
摘要: # Filename: using_dict.py # 'ab' is short for 'a'ddress'b'ook ab={ 'Swaroop' : 'swaroopch@byteofpython.info', 'Larry' : 'larry@wall.org', 'Matsumoto' 阅读全文
posted @ 2017-10-18 21:01 真勇士王小山 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #/usr/bin/env puthon (1)起始行(只有咋UNIX环境下使用,用来直接通过文件名来执行文件) “”“this is a test module” (2)模块文档(文档字符串) import sys import os (3)模块导入 debug=Ture (4)全局变量 clas 阅读全文
posted @ 2017-10-18 12:56 真勇士王小山 阅读(256) 评论(0) 推荐(0) 编辑