Hangman代码 [英] Hangman code

查看:82
本文介绍了Hangman代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

制作一个刽子手代码(我是n00b,还在教程阶段)


无论如何,这里是我的(绝密)代码:

Making a hangman code (I''m a n00b, still in the tutorial stage)

Anyway, here''s my (top-secret) code:

展开 | 选择 | Wrap | 行号

推荐答案


制作一个刽子手代码(我是n00b,还在教程阶段)


无论如何,这里是我的(绝密)代码:
Making a hangman code (I''m a n00b, still in the tutorial stage)

Anyway, here''s my (top-secret) code:
展开 | 选择 | Wrap | 行号



您好St33med。我们在这里看到的大多数代码都是仍在开发中;我们在这里帮助您实现目标。所以,欢迎来到TSDN上的Python帮助论坛!


这是范围的问题。范围规则表示在函数中分配的变量是本地的变量。到那个功能。我快速完成这项工作是(但可能不是最好的):
Hi St33med. Most code we see here is "still in development"; we''re here to help you get it working. So, welcome to the Python help forum on TSDN!

This is an issue of "scope". The scope rules say that variables assigned in a function are "local" to that function. I quick way to make this work is (but maybe not the best):
展开 | 选择 | Wrap | 行号


嗯,代码工作正常做了一些改进:
Well, the code worked and I made some enhancements:
展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于Hangman代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆