2018年9月6日

021_func

摘要: #!/usr/bin/env python# Author:liujundef func1(): #This is a function """ttest....""" print("in the func1") return 0def func2(): #This is a process """ 阅读全文

posted @ 2018-09-06 20:15 langjitianyadaolao 阅读(201) 评论(0) 推荐(0) 编辑

2018年9月5日

020_with

摘要: #!/usr/bin/env python# Author:liujunwith open("test","r",encoding="utf-8") as f: for line in f: print(line.strip())with open("test","r",encoding="utf- 阅读全文

posted @ 2018-09-05 20:13 langjitianyadaolao 阅读(83) 评论(0) 推荐(0) 编辑

018_IO

摘要: #!/usr/bin/env python# Author:liujunf = open("test","r",encoding="utf-8") # r --> readable # r --> writeable # r+ --> read and write # w+ --> write an 阅读全文

posted @ 2018-09-05 20:12 langjitianyadaolao 阅读(85) 评论(0) 推荐(0) 编辑

2018年9月4日

017_set

摘要: #!/usr/bin/env python# Author:liujunlist1 = [1,4,5,7,3,6,7,9]list1 = set(list1) # set is unorderedlist2 = set([2,6,0,66,22,8,4])print(list1.intersecti 阅读全文

posted @ 2018-09-04 22:29 langjitianyadaolao 阅读(95) 评论(0) 推荐(0) 编辑

016_dict

摘要: #!/usr/bin/env python# Author:liujuninfo = { 'stu1101':"TenglanWu", 'stu1102':"LongzaLuola", 'stu1103':"XiaoZeMaliya", 'stu1104':"TenglanWu", 'stu1105 阅读全文

posted @ 2018-09-04 21:14 langjitianyadaolao 阅读(407) 评论(0) 推荐(0) 编辑

015_string

摘要: #!/usr/bin/env python# Author:liujunname = "my name is aliex"print(name.capitalize()) # Capitalize the first letterprint(name.count('a')) # Count the 阅读全文

posted @ 2018-09-04 21:13 langjitianyadaolao 阅读(71) 评论(0) 推荐(0) 编辑

2018年9月3日

012_list

摘要: #!/usr/bin/env python# Author:liujunnames = [] # Define an empty listnames = ["ZhangYang", "Guyun", "XiangPeng", "XuLiangchen"]print(names)print(names 阅读全文

posted @ 2018-09-03 14:41 langjitianyadaolao 阅读(118) 评论(0) 推荐(0) 编辑

010_ternaryOperation

摘要: #!/usr/bin/env python# Author:liujuna,b,c = 1,3,5d = a if a < b else c /#if a < b , d = a else d = cprint(b) 阅读全文

posted @ 2018-09-03 14:40 langjitianyadaolao 阅读(105) 评论(0) 推荐(0) 编辑

008_standard_lib_os

摘要: #!/usr/bin/env python# Author:liujun#The standard libraryimport osres = os.system("ls -l") #used to execute commands and doesn't return anythingprint( 阅读全文

posted @ 2018-09-03 14:39 langjitianyadaolao 阅读(84) 评论(0) 推荐(0) 编辑

007_standard_lib_sys

摘要: #!/usr/bin/env python# Author:liujun#The standard libraryimport sys,timeprint(sys.path) #The value of PATH which is a environment variable in pythonpr 阅读全文

posted @ 2018-09-03 14:36 langjitianyadaolao 阅读(67) 评论(0) 推荐(0) 编辑

导航