How Do I import user input Into Dictionary

  python

How do I import user input into the dictionary for which I’m creating a table. This is using the tabulate module.

table1 = [['Gas Station Name', 'Price'], ['Shell', '3.23'], ['Texaco', '3.49'], ['BP', '2.98'], ['Sams Club', '3.02'], ['Kroger Gas', '3.12'], ['Cosco Gas', '3.91'] ]
print(tabulate(table1, headers='firstrow', tablefmt='grid'))

Like Instead of 3.02 for example how do I Collect the user input and Re-update the dictionary to be displayed on runtime.

I have also tried this for which I can collect User input for the prices and then output them to the console but how do I store them in the dictionary above so that the values change per the user input.

something that I also Tried

Source: Python Questions

LEAVE A COMMENT