python3 猜数字游戏
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3 猜数字游戏相关的知识,希望对你有一定的参考价值。
x=10 #the number you set to gess i=1 n=6 while(i<=6): print("@[email protected]:") print(n) print(" times left") y = input("please input the number you guess:") y = int(y) if(y == x): print("@[email protected]:") print("you win") break elif(y > x): print("@[email protected]:") print("the number you guess is a little bigger") elif(y < x): print("@[email protected]:") print("the number you guess is a little less") i = i + 1 n = n - 1 else: print("@[email protected]:") print("times use up,you lose")
本文出自 “净空蓝星” 博客,请务必保留此出处http://jingkonglanxing.blog.51cto.com/1152128/1858370
以上是关于python3 猜数字游戏的主要内容,如果未能解决你的问题,请参考以下文章