STEP 8: Notice that we've printed lists whose second item is a decimal.

Python initially interprets all text inside a CSV file as a string.

  • Press Run and Console. Do you see how there are quotes around our decimal? We need to cast it!
  • In LOGIC and , drag Convert to Float inside your loop and inside get_high_scores().
  • Then, change both instances of my_var to row[1]. We're now casting the second item in each list to a float!

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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)