This is my nested list
nlist =[[1,"https://w.org",{'delay':0},"segment"],[2,"https://w1.org",{'delay1':60},"segment2"], [3,"https://w.org",{'delay2:120'},"segment1"]]
I want to extract and do some operation as below how to do this in the pythonic efficient way for each list.
number = 1
timedelay = delay
url = https://w{}.format(timedelay).org #is delay add 0 in the format or add 60 in place
segment = segment
example :
https://w0.org+'/'+number+segment # add 0 when delay 0
https://w60.org+'/'+number+segment # add 60 when delay1
Please note that adding key pair value as per the dictionary i can rearrange the URL.
and repeat this for all list .
Requirement is if the timedelay is delay add 0 in the format or add 60 in place .This is something like choosing key value pair { 'delay':0 'delay':60} can this be also be put inside the list and a single for loop can be made to read the list and form URL and other variable assignment or should it be done only seperately in if loop after each of the list element is extracted?
in such list ["a" ,[b,c,d],ab] how to access c and what is the index of it.