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 阅读(123) 评论(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 阅读(109) 评论(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 阅读(88) 评论(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 阅读(70) 评论(0) 推荐(0)

006_for

摘要: #!/usr/bin/env python# Author:liujunfor i in range(1,10): if i==5: continue if i==8: break print("dddd ", i)for i in range(1,10): for j in range(1,10) 阅读全文

posted @ 2018-09-03 14:35 langjitianyadaolao 阅读(74) 评论(0) 推荐(0)

005_while

摘要: #!/usr/bin/env python# Author:liujunage=56count=0while count < 3: guessage = int(input("guess age:")) #Data type conversion is needed. if guessage == 阅读全文

posted @ 2018-09-03 14:34 langjitianyadaolao 阅读(107) 评论(0) 推荐(0)

004_if_else

摘要: #!/usr/bin/env python# Author:liujunage=56guessage = int(input("guess age:")) #Data type conversion is needed here.if guessage == age: print("yes you 阅读全文

posted @ 2018-09-03 14:33 langjitianyadaolao 阅读(93) 评论(0) 推荐(0)

003_if_else

摘要: #!/usr/bin/env python# Author:liujun_username="liujun"_passwd="123456"username = input("username:")password = input("password:")if _username==username 阅读全文

posted @ 2018-09-03 14:31 langjitianyadaolao 阅读(104) 评论(0) 推荐(0)

002_how to use getpass

摘要: #!/usr/bin/env python# Author:liujunimport getpassusername = input("username:")#password = input("password:")password=getpass.getpass("password:")prin 阅读全文

posted @ 2018-09-03 14:28 langjitianyadaolao 阅读(73) 评论(0) 推荐(0)

001_how to define a var and get the type of a var

摘要: #!/usr/bin/env python# Author:liujunname = "liujun"name2 = namename = "ll" #The value of name2 will not change if you change the value of namename = " 阅读全文

posted @ 2018-09-03 14:25 langjitianyadaolao 阅读(85) 评论(0) 推荐(0)

导航