第 14 步:我们更新了高分列表,但现在我们需要将更新后的数据添加到新的 CSV 文件中!

  • 这个函数需要两个参数:我们正在写入的新文件的名称和我们更新的数据。
  • ,在上面写着: MAIN FUNCTION的地方拖入Define Function with Docstring
  • my_function重命名为update_high_scores并在( )中键入file_name , my_data
  • 最后,将您的文档字符串更改为以下内容: """ Uses list of lists to write to new file """

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)