猫史档案馆


【Python作品分享】猜数字【作品秀】

用户:ljojjjiljojjji查看:0 回复:0 评论:0 创建时间:2022-11-27T12:18:25


【作品展示】

center_image

 

【作品介绍】

 

【作品源代码】

import easygui
import turtle
import random

__Pen = turtle.Pen()


aasscf = easygui.ynbox('欢迎来到猜数字游戏,本次猜数字范围为1~20。', 'Codemao', ('我已阅读', '点错了'))
if aasscf:
    image, 要猜的数字 = turtle.numinput('猜数字', '请输入数字', 1, 1, 100), random.randint(1, 20)
    while (要猜的数字 != image):
        easygui.msgbox('猜错了!', '猜数字', '好的')
        image = turtle.numinput('猜数字', '请输入数字', 1, 1, 20)
        if (要猜的数字 == image):
            break
    turtle.bgcolor("#ffffff")
    __Pen.pencolor("#000000")
    __Pen.goto((-160), 0)
    __Pen.clear()
    while True:
        __Pen.write('胜利啦!!!', font = ('Arial', 50, 'bold'))
else:
    __Pen.goto((-200), 0)
    __Pen.clear()
    while True:
        __Pen.write('当然可以答应!', font = ('Arial', 50, 'normal'))

def 猜数字():

    pass

aasscf

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页