Export Tags using Python

I’m trying to export tags using Python. I am able to export the tags names but am having issues where a task has multiple tags. I’m not sure if I should try to append in the for loop or use 2 for loops to get all the tags.