Answer the question
In order to leave comments, you need to log in
How to sort first and last name in VK API?
(I write in python)
Let's say I wanted to see the list of my friends in VK, but that's bad luck:
I write not only the names and surnames of friends, but also extra garbage!
print(vk.friends.get(fields='first_name, last_name'))
Answer the question
In order to leave comments, you need to log in
write this code:
user = vk.friends.get(fields='first_name,last_name')['items'][0]
print('id{0} - {1} {2}'.format(user['id'], user['first_name'], user['last_name']))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question