10 步:如果用户猜对了一个字母,我们需要在隐藏列表中显示该字母!

使用一个值,您可以使用.index()找到它在列表中的位置。这将返回一个值的索引位置。

  • 在逻辑和,在 if 块内添加Get Index of Value 。这告诉我们字母在哪里!
  • 将 my_var 更改为my_var ,将my_list更改为letter_index ,将word_list my_paramletter_guess

letter_index将存储正确猜测的字母的索引位置。我们将在下一个活动中使用这个索引!

    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)