python22期自动化-Day1
if 条件: 条件为真则执行else:
条件为假则执行
if 条件1:
条件1为真则执行
elif 条件2:
条件2位真则执行
else:
所有条件都不为真则执行
username = input('please input username: ')
password = input('please input password: ')
if username == 'wanliang' and password == '123456':
print('login success')
else:
print('login fail')
# if语句嵌套
msg = '''
1、查询话费
2、查水表
3、人工服务
'''
print(str(msg))
choice = input('please input choice: ')
if choice == '1':
print('1、查询本机;2、查询他人手机;3、查询座机')
search = input('please input search: ')
if search == '1':
print('查询本机')
elif search == '2':
print('查询他人手机')
elif search == '3':
print('查询座机')
else:
print('查询类型输入错误')
elif choice == '2':
print('查水表')
elif choice == '3':
print('人工服务')
else:
print('输入错误') 大佬想买 楼主,你的课程可以出售么
页:
[1]