[Partial Solution]
I think the Gerrat correctly uses locals, the limitations here, because some of the data in lab reports will never change.
#!/usr/bin/python
#
# Description: smelling overuse, probably a roundabout of other problem, rethinking...
variables = ['x','y']
datas = ['1,2,3,4', '4,44,8,3']
for var, data in zip(variables, datas):
locals()[var] = data
#Testing
print(x +" should be '1,2,3,4'");
print(y +" should be '4,44,8,3'");
[SOLUTION]
jonesy and John Kugelman spot other problem, you need to use dynamic data structrures such as dictionary, a cleaned example below.
variables = ['y', 'x', 'xE']
values = dict((name, None) for name in variables)
# GOAL TO GET ASSIGNMENT LIKE, data is in files "y, x, xE":
for name in variables:
values[name] = open('./'+name).read()
# Testing, prints the contents
for val in variables:
print(values[val]);
[Solution 2] by jonesy, it is actually the clearest code.
klist = ['x', 'y']
data = ['2,3,4', '5,5,6']
mydict = dict(zip(klist, data))
# mydict['x'] == '2,3,4'