Answer the question
In order to leave comments, you need to log in
Python dictionary change value along path?
Hello, tell me how to change the value in the dictionary along the way in the most beautiful way. A dictionary can contain both dictionaries and lists inside.
For example dictionary:
{ "test1" : "hello",<br/>
"test2" : [ "ok", "ok1", "ok2" ],<br/>
"test3" : { "sub1" : [0,1,2,3],<br/>
"sub2" : 1}<br/>
}
test3/sub1/2 + 4
{ "test1" : "hello",<br/>
"test2" : [ "ok", "ok1", "ok2" ],<br/>
"test3" : { "sub1" : [0,1,4,3],<br/>
"sub2" : 1}<br/>
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question