我是靠谱客的博主 明亮紫菜,这篇文章主要介绍python初接触,现在分享给大家,希望可以做个参考。

# guess LuckyNum
# 练习使用if_else语句
# 使用循环语句while
# 与、或、非 and、or、not

MyLuckNum = 66
NumInput = 0
GuessCount = 5
# while True:
while MyLuckNum != NumInput and GuessCount != 0:
NumInput = int(input("Please input number (0~100):"))
GuessCount -= 1
print("GuessCount=", GuessCount)

if NumInput <= 100:
if NumInput > MyLuckNum:
print("the real num is smaller")
elif NumInput < MyLuckNum:
print("the real num is bigger")
else:
print("Input Error!")
if GuessCount == 0 and MyLuckNum != NumInput:
print("time is over!")
else:
print("bingo!")

编码

转载于:https://www.cnblogs.com/BlogOfEr/p/8334103.html

最后

以上就是明亮紫菜最近收集整理的关于python初接触的全部内容,更多相关python初接触内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部