三级菜单-递归和堆栈的方法写
摘要:menu = { '北京': { '朝阳': { '国贸': {}, 'CICC': {}, 'HP': {}, '渣打银行': {}, 'CCTV': {}, }, '望京': { '陌陌': {}, '奔驰': {}, '360': {}, }, '三里屯': { '优衣库': {}, 'app
阅读全文
posted @
2019-10-20 17:52
Test-Billy
阅读(316)
推荐(0)
处理异常 ‘try’——‘except’ 方法
摘要:try: name 2+'3' [][3] {}['k'] ret = int(input('number>>>')) print(ret*'*')except ValueError: print('输入的数据有误')except Exception: print('你错了,老铁')else: pr
阅读全文
posted @
2019-10-19 23:30
Test-Billy
阅读(4599)
推荐(0)
python -生成随机的验证码
摘要:import randomdef v_code(): code= '' for i in range(5): num = random.randint(0,9) #随机生成0到9的整数 alf = chr(random.randint(65,90)) #根据 ascii码,随机生成字母 add =
阅读全文
posted @
2019-10-15 14:54
Test-Billy
阅读(383)
推荐(0)