基础需求:ui
# i=0
# profile = {
# 'alex':{'password':'123','count':0},
# 'matthew':{'password':'456','count':0},
# 'egon':{'password':'789','count':0}
# }
# while True:
# i+=1
# name=input('enter your name:')
# if name in profile:
# password=input('enter your password:')
# if password == profile[name]['password']:
# print('welcome')
# break
# else:
# print('密码错')
# profile[name]['count']+=1
# if profile[name]['count']>2:
# print('用户锁定')
# break
# elif i == 3:
# print('too many times')
# break
# else:
# print('用户不存在')
# continue
使用while循环实现输出2-3+4-5+6...+100 的和
b. 使用 while 循环实现输出 1,2,3,4,5, 7,8,9, 11,12 使用 while 循环实现输出 1-100 内的全部奇数this
e. 使用 while 循环实现输出 1-100 内的全部偶数ip
a=0
# b=1
# while True:
# print(b)
# b+=2
# if b == 101:
# break
# while True:
# print(a)
# a+=1
# if a ==13 :
# break
打印省、市、县三级菜单 可返回上一级 可随时退出程序
menu= {# '北京':{# '朝阳':{# '像素':{},# },## '西城':{# '西单':{},# },# '东城':{# '东单':{},# }# },# '天津':{# '和平':{# '大悦城':{},## },# '南开':{# '大悦城':{},# },# '河北':{# 'Matt':{},# },# },# }# control= menu# for i in menu:# choice=input('choice...').strip()# if choice not in menu : print('not in this mune...')# if choice == 'quit': break# control=control[choice]