摘要: #!/usr/bin/env pythoninfo = { 'stu1101': "TengLan Wu", 'stu1102': "LongZe Luola", 'stu1103': "XiaoZe Maliya",}print(info)print(info['stu1101'])info['s 阅读全文
posted @ 2018-11-04 19:27 rongye 阅读(186) 评论(0) 推荐(0) 编辑
摘要: My name is {name} and my age is {year}5 my name is {name} and my age is {year} Falsemy name is {name} and my age is {year}3my name is lian and my age 阅读全文
posted @ 2018-11-04 18:39 rongye 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env pythonproduct_list = [ ('Iphone',5800), ('Mac Pro',9800), ('Bike',800), ('Watch',10600), ('Coffee',31), ('Alex Python',120),]shopping_l 阅读全文
posted @ 2018-11-04 16:50 rongye 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 元组其实跟列表差不多,也是存一组数,只不是它一旦创建,便不能再修改,所以又叫只读列表 语法 1 names = ("alex","jack","eric") 1 names = ("alex","jack","eric") 1 names = ("alex","jack","eric") 1 nam 阅读全文
posted @ 2018-11-04 15:14 rongye 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ['alex', ['saving', 50]]['fengjie', ['saving', 50]] 阅读全文
posted @ 2018-11-04 11:52 rongye 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 我爱北京b'\xe6\x88\x91\xe7\x88\xb1\xe5\x8c\x97\xe4\xba\xac'我爱北京 阅读全文
posted @ 2018-11-04 11:08 rongye 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 result = 值1 if 条件 else 值2 1 result = 值1 if 条件 else 值2 1 result = 值1 if 条件 else 值2 1 result = 值1 if 条件 else 值2 result = 值1 if 条件 else 值2 如果条件为真:resul 阅读全文
posted @ 2018-11-04 10:29 rongye 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env pythonimport sysprint(sys.path)#打印环境变量print(sys.argv)#打印['F:/python/s14/day2/sys.py']及输入参数import oscmd_res = os.system("dir")#调用系统命令,直接 阅读全文
posted @ 2018-11-04 09:38 rongye 阅读(136) 评论(0) 推荐(0) 编辑
摘要: info1=''' info of %s age:%djob:%s''' %( name,int(age),job)print(info1) info2=''' info of {_name} age:{_age}job:{_job}'''.format( _name=name, _age=age, 阅读全文
posted @ 2018-11-04 09:07 rongye 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 有一种循环叫死循环,一经触发,就运行个天荒地老、海枯石烂。 海枯石烂代码 1 2 3 4 5 count = 0 while True: print("你是风儿我是沙,缠缠绵绵到天涯...",count) count +=1 1 2 3 4 5 count = 0 while True: print 阅读全文
posted @ 2018-11-04 08:58 rongye 阅读(178) 评论(0) 推荐(0) 编辑