hb120973135 发表于 2018-8-14 09:55:02

Python的Whiel循环和if流程判断

  _age = 27
  count = 0
  while count < 3:
  age = input("what is you age? ")
  if age == _age:
  print "ni cai de {yourage} is sussccess" .format(yourage=age)
  break
  elif age < _age:
  print "ni cai de {yourage} nianlin xiao yu age" .format(yourage=age)
  else:
  print "ni cai de {yourage} nianlin da yu age" .format(yourage=age)
  count += 1
  #if count ==3:
  #countine_confirm = raw_input("do you want to keep guessing..? ")
  #if countine_confirm != 'n':
  #count=0
  else:
  print 'all count yong wan le'
页: [1]
查看完整版本: Python的Whiel循环和if流程判断