====[python]====
comm = [0,5,10,2,7,4]
db = [
dict(name='user', text='hello, world'),
dict(name='guest', text='Test Passed'),
dict(name='user', text='what?'),
dict(name='tr', text='che?'),
dict(name='user', text='where?'),
dict(name='tr', text='gde?'),
dict(name='user', text='who?'),
dict(name='tr', text='kto?'),
dict(name='user', text='whoami?'),
dict(name='tr', text='che za baida?'),
dict(name='root', text='Last Comment')
]
ret = [db[x] for x in comm]
[print (x['text']) for x in ret]
user = lambda user: [x['text'] for x in db if x['name'] == user]
out = [(db[x],user(db[x]['name'])) for x in comm]
print (out)