list position vectors

I was trying to place many position vectors in a list to place a instanced cube in different position. But it did not work.How would i do that?Here is my code.

import bge
def main():
    
    cont = bge.logic.getCurrentController()
    scene = bge.logic.getCurrentScene()
    player = scene.objects ["player"]
        
    objx = cont.owner
    
    if obj.getDistanceTo(player) > 29:
    objx = scene.addObject("lung", player, 0)
    objx.worldPosition = [[3,4,5],[2,2,2],[1,6,7],[3,3,3]]
 
 


main()

You should add it four times and then set the positions four times.

So it is not possible to put all the position vectors on the same line?Or set the position many times on the same line.

No I don’t think so, as your adding it just once so its just one instance, how can a single thing be at four different places at the same time.

How would i add the lung three times on the same line in the code?

You can use a for loop, something like this.
(I haven’t tested it)

import bge


cont = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
player = scene.objects ["player"]


objx = cont.owner
list = [[3,4,5],[2,2,2],[1,6,7],[3,3,3]]
length = len(list) #gets the number of items in the list


if objx.getDistanceTo(player) > 29:
    for i in range(0, length): #loops through the code the same number of times as their are items in the list
        objx = scene.addObject("lung", player, 0)
        objx.worldPosition = list[i] #assigns the position to the object at index 'i' in the list

obj was not defined.So i changed it objx and it worked.Thankyou for the example.