第 9 步:让我们看看用户回答"a"的频率!

我们使用Get Count来计算字符串在列表中出现的次数。

  • 并将Get Count拖到循环之外的程序底部。
  • 将存储计数的变量的名称更改为a_num
  • 将 .count .count()命令中的my_list更改为user_choices并将my_param更改为字符串" a"

    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)