7007 发表于 2018-8-5 08:48:49

python基础1-feng

猜数字3  
age = 50
  
count=0
  
while count < 3:
  
    _age = int(input(&quot;age:&quot;))
  
    if _age == age :
  
      print(&quot;you guessed right&quot;)
  
      break
  
    elif _age > age:
  
         print(&quot;The number is too big&quot;)
  
    else:
  
         print (&quot;The number is too small&quot;)
  
    count +=1
  
    if count == 3:
  
      continue_confirm=input(&quot;do you want continue.....?&quot;)
  
      if continue_confirm != &quot;n&quot;:
  
            count = 0
页: [1]
查看完整版本: python基础1-feng