Answer the question
In order to leave comments, you need to log in
How to get the first and last name by id VK user Python?
gives an error:
line 3, in
session = vk.Session()
NameError: name 'vk' is not defined
how to do it right?
import vk_api
session = vk.Session()
api = vk.API(session, v = 5.103)
id = 1
response = api.users.get(user_ids = id)
first_name = response[0]['first_name']
second_name = response[0]['second_name']
print(first_name)
print(second_name)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question