I would use dictionaries:
parm = {} var_names = ['x1', 'y1', 'a1', 'b1', 'x2', 'y2'] for var_name in var_names: parm[var_name] = int(input())
then you can convert the dictionary keys to variables, but I don't think this is a good idea:
locals().update(parm)
source share