I have to assign variables from .dat files that are properly formatted 4 line input files. The variables I have to assign are
xc , yc
r
x1, y1
x2 , y2
The .dat files will be formatted so that each line contains the data for each set of those variables.
The problem says this Python statement should be able to evaluate the first line of the input file when redirected to stdin
xc,yc = eval(input())
But I have tried to do it as so
xc , yc = map(int, input().split(','))
r = map(int, input().split(','))
x1 , x2 = map(int, input().split(','))
x2 , y2 = map(int, input().split(','))
But this doesn't work, I get an error on line 1 that says:
Invalid literal for integer with base 10 (',').
I would appreciate it if someone could help me with reading these .dat files and assigning them to each of these variables.