xuol001 发表于 2018-8-11 06:30:31

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('输入错误')

ddy4633 发表于 2018-12-17 17:28:32

大佬想买

Brave20181122 发表于 2018-12-17 19:31:33

楼主,你的课程可以出售么
页: [1]
查看完整版本: python22期自动化-Day1