python练习:猜价钱小游戏

#猜价钱
trueprice = 202
price = input("Please guess the price:")
while (int(price) != trueprice):
    if(int(price) > trueprice):
        price = input("Your price is higher,Please try again:")
    else:
        price = input("Your price is lower,Please try again:")
print("Great! The price is %s"  %price)

 

posted @ 2019-07-15 16:39  lx_yykl  阅读(1001)  评论(0编辑  收藏  举报