pythonturtle如何在while循环中对函数进行键控?

2024-04-27 00:57:45 发布

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

运行代码时,函数根本不起作用
以下是问题代码,希望您能提供帮助:

import turtle


.
.

^{pr2}$


.
.

谢谢,这很重要


Tags: 函数代码importturtlepr2
1条回答
网友
1楼 · 发布于 2024-04-27 00:57:45

请解释您希望代码做什么。此外,在函数开始的while循环之后有一个缩进错误。在

while plinput == 0:

    def OnePlayer():
        global plinput
        plinput = 1

    def TwoPlayers():
        global plinput
        plinput = 1

    def ThreePlayers():
        global plinput
        plinput = 1

    def FourPlayers():
        global plinput
        plinput = 1

希望这有帮助。:)

相关问题 更多 >