文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Python Test

Python Test

时间:2010-12-29  来源:chauncey

 

import random

number = random.randint(0,5)

#print number

def askTry():
    tryInput =raw_input('Try again?:')
    
    if(tryInput== 'yes'):
       
       nextInput = raw_input('Try Input your number:')
       newNumber = int(nextInput)
       def tryInputNum():
           if(newNumber == number):
               print 'cool!!!'
           if(newNumber < number):
               print 'What are you doing ? Too small!!!难道你是白痴吗?'
               askTry()
           if(newNumber > number):
               print 'What are you doing ? Too large!!!!难道你是傻子吗?'
               askTry()
       tryInputNum()
   ##########################  
    elif(tryInput != 'yes'):
       print "OK,you will go...you should enter 'no'"
       pass
   ##########################
                     
inputNumber = raw_input('Please enter your number:')
if inputNumber =='':
    print 'youmust enter a number......'
    pass
if inputNumber !='':
    
    nowNumber =int(inputNumber)

    if(nowNumber == number ):
       print 'You are great!!!'

   elif(nowNumber <number):
       print 'Too small!!!'
       askTry()

   elif(nowNumber > number):
       print 'Too large!!!'
       askTry()

 

 

 

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载