I am trying to create the following syntax using a for loop:
file_1_0 = data[0][0]
file_1_1 = data[0][1]
file_1_2 = data[0][2]
file_1_3 = data[0][3]
file_1_4 = data[0][4]
file_1_2 = "{:,}".format(file_1_2)
file_2_0 = data[1][0]
file_2_1 = data[1][1]
file_2_2 = data[1][2]
file_2_3 = data[1][3]
file_2_4 = data[1][4]
file_2_2 = "{:,}".format(file_2_2)
Given below is the for loop that I tried to achieve the above:
for i in range(1, len(file_data)):
for k in range(0, len(file_data) - 1):
for j in range(0, 4):
str(file_) + str(i) + str(_) + str(j) = str(locals()["data_" + str(k) + "_" + str(j)])
I get an error
SyntaxError: can't assign to operator