x=10 #the number you set to gess i=1 n=6 while(i<=6): print("@_@:") print(n) print(" times left") y = input("please input the number you guess:") y = int(y) if(y == x): print("@_@:") print("you win") break elif(y > x): print("@_@:") print("the number you guess is a little bigger") elif(y < x): print("@_@:") print("the number you guess is a little less") i = i + 1 n = n - 1 else: print("@_@:") print("times use up,you lose")
本文出自 “净空蓝星” 博客,请务必保留此出处http://jingkonglanxing.blog.51cto.com/1152128/1858370
原文地址:http://jingkonglanxing.blog.51cto.com/1152128/1858370