Search code examples
pythonprompttabularhardcode

Using Table with Python


I need to incorporate a table into my python program so when I run my program it can read the information from the table as it is needed. What is the best way to incorporate the table into my program so that it is familiar with it when the program is ran?

This is the table that I will incorporate into my program:

enter image description here


Solution

  • You might use Excel or Google Sheets.

    1. Paste the table into your spreadsheet
    2. Export the sheet to CSV
    3. Use Python's csv library to import the data

    https://docs.python.org/3/library/csv.html