Hi I am practice list and I get TypeError: can only concatenate list (not "str") to list
How to fix it ?
My code
from bs4 import BeautifulSoup
tag_list= ['Flying','Flight']
links = ['https://goo.gl/'+x for x in tag_list+'/text']
print links
it will give me error but if I edit my code to this , it will work.
tag_list= ['Flying','Flight']
links = ['https://goo.gl/'+x for x in tag_list]
print links
May I ask how to fix links = ['https://goo.gl/'+x for x in tag_list+'/text']
tag_list + 'text'
?['Flyingtext','Flighttext']
? – falsetru Nov 19 '16 at 7:55tag_list + ['text']
– furas Nov 19 '16 at 7:55['https://goo.gl/{}/text'.format(x) for x in tag_list]
– vaultah Nov 19 '16 at 8:01