16 步:让我们尝试更多的测试用例,并确保程序按我们希望的方式运行。

  • 我们的循环不是无限的!从while循环中删除这段代码: print( "Infinite · loop!" )
  • 点击运行并输入单词error 。当你猜到r时会发生什么?
  • 用一些其他的话来试试while循环的效果。试试像密西西比香蕉土豚这样的词!
  • 查看现在包含在while循环中的代码。它如何防止while循环无限?

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)