标签:不同的 基本数据 操作 输入 read auto div oid 数据类型
students_info = [[‘egon‘, 18, [‘play‘, ]], [‘alex‘, 18, [‘play‘, ‘sleep‘]]] print(students_info[0][2][0])
info = { ‘name‘: ‘egon‘, ‘hobbies‘: [‘play‘, ‘sleep‘], ‘company_info‘: { ‘name‘: ‘Old boy‘, ‘type‘: ‘education‘, ‘emp_num‘: 40, } } # 请取出取公司名: print(info[‘company_info‘][‘name‘])
students = [ {‘name‘: ‘alex‘, ‘age‘: 38, ‘hobbies‘: [‘play‘, ‘sleep‘]}, {‘name‘: ‘egon‘, ‘age‘: 18, ‘hobbies‘: [‘read‘, ‘sleep‘]}, {‘name‘: ‘wupeiqi‘, ‘age‘: 58, ‘hobbies‘: [‘music‘, ‘read‘, ‘sleep‘]}, ] print(students[1][‘hobbies‘][1])
while True: account = input(‘your account:‘) password = input(‘your password‘) if account == ‘Avery‘: if password == ‘369‘: print(‘登陆成功‘) exit() else: print(‘密码输入错误,请重新输入‘) continue else: print(‘账号输入错误,请重新输入‘)
account_dic = { ‘Avery‘: ‘369‘, ‘Kaia‘: ‘123‘ } while True: account = input(‘your account:‘) password = input(‘your password‘) if account in account_dic: if password == account_dic[account]: print(‘登陆成功‘) exit() else: print(‘密码输入错误,请重新输入‘) continue else: print(‘账号输入错误,请重新输入‘)
标签:不同的 基本数据 操作 输入 read auto div oid 数据类型
原文地址:https://www.cnblogs.com/avery-w/p/14192842.html