第12 步:如果用户猜错了单词,我们会告诉他们再试一次,然后再次运行循环。

  • 去并拖出if 。它应该只缩进一次 - 在循环中!
  • 将测试变量从choice更改为guess ,将测试值从"yes"更改为password 。
  • 将==符号更改为!= 。在 Python 中,比较运算符!=表示不等于。
  • 在图形中,单击并将Say放到if语句中。总共将缩进 8 个空格!

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)