# 做业:# 添加工程根目录至环境变量 要求能够跨平台# import sys,os# BATH_DIR=os.path.dirname(os.path.dirname(__file__))# sys.path.append(BATH_DIR)# 1.课堂上的随机验证码练习# 长度5 包括0-9 A-Z a-zimport randomdef get_auth_code(lenght): res='' for i in range(lenght): a=random.randint(0,9) b=chr(random.randint(65,90)) c=chr(random.randint(97,122)) s=random.choice([a,b,c]) res+=str(s) return resprint(get_auth_code(5))