Python错误:关键字不能是表达式。打印值

2024-10-04 07:33:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在做一个游戏,有一个假加载屏幕开始。我试着做一个逐步的伊利普斯,每秒钟加一个周期,直到有3个周期为止。这是我输入的代码:

    def intro2():
        print('Loading CapsuleCorp computer'=end)
        time.sleep(1)
        print ('.'=end)
        time.sleep(1)
        print ('.')
        time.sleep(3)
        print ('Welcome to the CapsuleCorp main computer.')
        time.sleep(1)
        print ('Due to new security issues, we have added a new security system.')
        print ('If you are an employee, we teach you these maditoraly.')
        time.sleep(1)
        print ('we wipe your mind as an ex-enployee')

然后,在运行之后,我得到一个错误:

^{pr2}$

它强调了这一点:

    print**(**'Loading CapsuleCorp computer'=end)

Tags: toyouan游戏new屏幕timesleep
1条回答
网友
1楼 · 发布于 2024-10-04 07:33:39

这将修复它:

print('Loading CapsuleCorp computer=', end)

根据您在下面的附加评论,您可能正在寻找:

^{pr2}$

相关问题 更多 >