0
I’m tweaking a Pathfindig code based on A*,
I need to check and modify an element within a list with several sub-lists, but I have doubts if I use a repeat loop, or if there is already a function that does this, (Return as value the position of this element in the list).
V = 3, 3 # V equivale ao elemento[0] de cada sub-lista.
lista = [[[1,3] 2,1 , 40, 90], [[2,3] 3,2 , 60, 50], [[3,3] 4,2 , 70, 15]...]
As I can for example check if V is in the list and if I was, how can I change it. Thanks in advance!
What language ? Python ?
– Isac
Ops forgot that detail, yes it’s python.
– Marcos Vinícius
What would those be
[1,3]
,[2,3]
and[3,3]
? Didn’t make much sense.– Woss
In my code they are coordinates of a map (initially of characters), where each element of the list is a position, with its information. (In this example I put random values in these coordinates because it is just an example,)
– Marcos Vinícius
But
V
is a tuple whereas[3,3]
is a list with two elements– Isac