News for hackers. Stuff that matters.
Re:Advanced Python Mastery – A Course by David Beazley by kstrauser on Wednesday July 19, 2023 @05:25PM (#36793657)
Or even:

  def read_portfolio(filename):
      with open(filename) as f:
          rows = csv.reader(f)
          headers = next(rows)
          return [
              {
                  "name": r[0],
                  "shares": int(r[1]),
                  "price": float(r[2]),
              }
              for r in rows
          ]

There are no comments on this comment yet.