摘要:
#!/usr/bin/env pythoninfo = { 'stu1101': "TengLan Wu", 'stu1102': "LongZe Luola", 'stu1103': "XiaoZe Maliya",}print(info)print(info['stu1101'])info['s 阅读全文
摘要:
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 阅读全文
摘要:
#!/usr/bin/env pythonproduct_list = [ ('Iphone',5800), ('Mac Pro',9800), ('Bike',800), ('Watch',10600), ('Coffee',31), ('Alex Python',120),]shopping_l 阅读全文
摘要:
元组其实跟列表差不多,也是存一组数,只不是它一旦创建,便不能再修改,所以又叫只读列表 语法 1 names = ("alex","jack","eric") 1 names = ("alex","jack","eric") 1 names = ("alex","jack","eric") 1 nam 阅读全文
摘要:
['alex', ['saving', 50]]['fengjie', ['saving', 50]] 阅读全文
摘要:
我爱北京b'\xe6\x88\x91\xe7\x88\xb1\xe5\x8c\x97\xe4\xba\xac'我爱北京 阅读全文
摘要:
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 阅读全文
摘要:
#!/usr/bin/env pythonimport sysprint(sys.path)#打印环境变量print(sys.argv)#打印['F:/python/s14/day2/sys.py']及输入参数import oscmd_res = os.system("dir")#调用系统命令,直接 阅读全文
摘要:
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, 阅读全文
摘要:
有一种循环叫死循环,一经触发,就运行个天荒地老、海枯石烂。 海枯石烂代码 1 2 3 4 5 count = 0 while True: print("你是风儿我是沙,缠缠绵绵到天涯...",count) count +=1 1 2 3 4 5 count = 0 while True: print 阅读全文