在下面的代码中,如何在'end'函数中为变量'猜测'提供.每当我尝试这个,我只是收到猜测没有定义.在播放函数中,我返回一个数字,如果我理解正确,那么该数字应该等于'猜猜',并且由于某种原因我不理解'猜测'将不会在'结束'中起作用.
def main():
guesses = play()
play_again = again()
while (play_again == True):
guesses = play()
play_again = again()
total_games = 1
total_games += 1
end()
def end():
print("Results: ")
print("Total: " + print(str(guesses + 1)))
Run Code Online (Sandbox Code Playgroud) python ×1