Answer the question
In order to leave comments, you need to log in
How to get the necessary data?
import vk
session = vk.Session()
api = vk.API(session, v = 5.8)
token = 'token'
id = 1
api.users.get(access_token = token, user_ids = id)
Answer the question
In order to leave comments, you need to log in
Check out the core Python collections.
Lists (list type):
https://pythonworld.ru/tipy-dannyx-v-python/spiski...
Dictionaries (dict type):
https://pythonworld.ru/tipy-dannyx-v-python/slovar. ..
Especially regarding the reference to the element of the list / dictionary by index.
Then you can do like this:
...
response = api.users.get(access_token = token, user_ids = id)
first_name = response[0]['first_name']
print(first_name)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question