Answer the question
In order to leave comments, you need to log in
How to make a row and not a column in a for loop?
I wrote a code that mentions all users in cf, but there is one problem, because of the loop, it writes all users to a column, and when I tried to make it into a row, I got only one last user. Here is the code:
if message == '/an':
chat = vk.messages.getConversationMembers(peer_id=event.obj.peer_id, group_id=group)
profiles = chat['profiles']
for i in range(len(profiles)):
text = ''
text += f"[id{profiles[i]['id']}|{profiles[i]['first_name']} {profiles[i]['last_name']}], "
vk.messages.send(peer_id=event.obj.peer_id, message=text, random_id=rand)
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