摘要:
递归: def list_in(s): result = 0 lst = os.listdir(s) for i in lst: i = s + "/" + i if os.path.isfile(i): result = result + os.path.getsize(i) elif os.pa 阅读全文
摘要:
import osusername = input("请输入用户名:")password = input("请输入密码:")lst = os.listdir()if "alex" in lst: print("文件已存在!")else: if username == "alex" and passw 阅读全文
摘要:
import sysusername = sys.argv[1]password = sys.argv[2]if username == "alex" and password == "123465": print("Congratulation")else: exit() 阅读全文
摘要:
import timetime1 = "2019-08-01 19:32:02"time2 = "2020-01-02 18:21:31"struct_time1 = time.strptime(time1, "%Y-%m-%d %H:%M:%S")struct_time2 = time.strpt 阅读全文
摘要:
import randomdef func(a=6, alpha=True): s = "" for i in range(a): num = str(random.randint(0, 9)) if alpha: alpha_upper = chr(random.randint(65, 90)) 阅读全文