I want to modify the below code to read the Polynomial Terms from a text file (vs. hard-coded values)

Furthermore, read data from text file in the format:

P1 = 3 5 1 -1 0 8

P2 = 5 6 2 -1 1 7...