第9步:首先,如果龙已经显示了这个单词中的所有字母,我们将结束循环。结果通过检测 revealed_letters 的长度是否等于 word 的长度来判断。

len() 用于在 Python 中获取字符串的长度。

  • 点击 并拖出 Length 。将变量的名称更改为 revealed_length
  • len() 中的变量参数更改为 revealed_letters

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)