When I run the following code:
for elems1 in L1:
---some-actions---
for val in value:
result = val1,val2,val3
L2.append(result)
print(L2)
#additional tasks
for vals in L2:
---additional-tasks to be performed---
And print (L2) I get the output as :
['val1']
['val1','val2']
['val1','val2','val3']
I need to iterate over the values of these two lists in nested for loops but it is printing thrice and separating each value. why?