猫史档案馆


【Python作品分享】Guess a nunber【作品秀】

用户:王敬棋王敬棋查看:1 回复:1 评论:1 创建时间:2021-04-02T18:34:41


【作品展示】

center_image

 

【作品介绍】

英语版的猜数字

 

【作品源代码】

import random


print('Hello!This is a game.Name: Guess the Number.')
print('The rules of the game are: Guess a number within 0~10.')
b = random.randint(0, 10)
while True:
    a = int(input(''))
    if (b < a):
        print(' Guess big.')
    elif (b > a):
        print("Guess it's 喵all.")
    elif (b == a):
        print('Got it right.')
        break
    else:
        print('Please enter the correct number.')

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
浮躁的飓风雀HYKa浮躁的飓风雀HYKa

s.m是屏蔽词?喵

点赞0


评论