19 步:如果用户猜对了所有字母,让我们停止for循环!

  • if not in for循环内添加。它应该缩进一次,所以它在for循环中。
  • 将测试值从my_var更改为"#" ,并将列表更改为hidden_list 。当玩家猜对时,我们将每个“#”替换为一个字母,所以如果没有“#”,那么用户就猜对了所有字母!
  • ,在 if 块中添加Break ,缩进两次!当玩家获胜时,循环结束!

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)