The population_gen function returns a list of tuples that are automatically unpacked into variable names using this syntax.
So, as the return value from the function, you get the following value:
[("pos1", "target1"), ("pos2", "target2"), ]
In this example, in the first iteration of the for loop, the variables "position" and "target" will have the following values:
position = "pos1" target = "target1"
In the second iteration:
position = "pos2" target = "target2"
Erik forsberg
source share