Answer the question
In order to leave comments, you need to log in
What to do with TypeError: can only concatenate str (not "int") to str?
In short, I am mastering vk api for myself and decided to draw a conclusion from the data from the link. Link example vk.com/v=0 .
I have a link 'vk.com/' added with 'v=0' through '+' ('vk.com/' + v= + peremennaya)
below I have a loop that adds to v +1, it adds a number to vk. com/v=0 and performs an action on it.
But the loop does not work in Python, because I convert the number to a string so that I can connect it with a link, but because of this, the loop does not work (because it cannot add a number to the string).
Thank you all in advance, here is a sample code:
offset = 0
res = 'https://vk.com/v=' + 0
while (c != 10):
offset += 1
c += 1
Answer the question
In order to leave comments, you need to log in
'https://vk.com/v=' + 0
'https://vk.com/v=' + str(0)
while (c != 10): offset += 1 c += 1
for c in range(10):
offset += 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question