第 8 步:我们游戏中一个非常重要的部分将是大写和小写字母!

.upper().lower()将字符串中的所有字母更改为大写或小写!

  • 使用stage .ask()找到您刚刚在最后一个活动中添加的代码行。
  • .lower()添加到该代码的末尾,如下所示: stage .ask( "Guess a letter!" , 0 , -200 ).lower()
  • letter_guess中存储一个小写字母很重要,因为我们将检查它是否在单词中!

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)