2017-01-30 52 views

回答

3
mylist=["str1","str2","str3"] 

print("".join('<mytag>{}</mytag>'.format(x) for x in mylist)) 

如果你需要更復雜的東西,那麼你應該使用lxmlBeautifull

+0

這個心不是工作 – akhilviswam

+0

它爲我的作品 - 你得到錯誤信息或者是什麼? – furas

+0

它打印爲str122str2str3 – akhilviswam