Q:

how to search efficiently items in the list?

I have list of dicts:
[
    {"num": 60, "name": "A"}, 
    {"num": 50, "name": "B"}, 
    {"num": 49, "name": "C"}, 
    ... etc
]

And list created like this:
[[x, {}] for x in xrange(0, mylist[0]['num'])]

list:

[..., [50, {}], [51, {}], ... , [60, {}], ...,  [65, {}], ... etc]

And I would get something like this:
[..., [50, {"num": 50, "name": "B"}], [51, {}], ..., [60, {"num": 60, "name": "A"}], ..., [65, {}], ... etc]

How to do it?

A:

You can loop over your list and get the relative number with a simple indexing :
>>> [[k['num'],k] for k in li]
[[60, {'num': 60, 'name': 'A'}], [50, {'num': 50, 'name': 'B'}], [49, {'num': 49, 'name': 'C'}]]

If you want the lists with empty dictionaries for missing nums you can use a list comprehension like following, for example :
>>> l=[2,3,6,10]
>>> z=zip(l,l[1:])
>>> [t for i,j in z for t in range(i,j)]+[l[-1]]
[2, 3, 4, 5, 6, 7, 8, 9, 10]

A:

In your question, you wrote

And I would get something like this:
[..., [50, {"num": 50, "name": "B"}], [51, {}], ..., [60, {"num": 60, "name": "A"}]

The accepted answer gives you something different, so I'd like to add an answer more faithful to your original request.
This answer is based on the observation that you wrote xrange(0, mylist[0]['num']) leading me to think that the topmost number in your list is in the first position, and further inspection of the example data showed that actually the numbers were given in decreasing order... so that I eventually assumed that in the original list there is an order.
Based on this assumption, here it is my code
# data source
l0 = [{"num": 60, "name": "A"}, {"num": 50, "name": "B"}, {"num": 49, "name": "C"}]

# initialization, length of data source, void data destination,
# start from beginning of data source
ll0, l1, nl = len(l0), [], 0

# the loop is downwards, because we want to match the numbers
# in data source from high to low
for n in range(l0[0]['num'], 0, -1):
    # first test avoids IndexError, second test is your condition
    if nl < ll0 and l0[nl]['num'] == n:
        l1.append([n, l0[nl]])
        # if we had a match, we switch our attention to the next item
        # in data source, hence increment the index in data source
        nl += 1
    else:
        l1.append([n, {}])

# we built the data destination list from top to bottom,
# you want from bottom to top, hence
l1.reverse()

To repeat myself, this code assumes a particular ordering in your data source, if this assumption doesn't hold I'd be more than happy to retire my answer.

