Your code is a bit confusing. It would be more clear to do:
a = ''.join(doc[a1])
b = ''.join(doc[a2])
c = ''.join(doc[a3])
d = ''.join(doc[a4])
e = ''.join(doc[a5])
f = ''.join(doc[a6])
g = ''.join(doc[a7])
h = ''.join(doc[a8])
i = ''.join(doc[a9])
j = ''.join(doc[a10])
The syntax you're using is usually used in instances like:
str_ = "a,b"
a, b = str_.split(",")
# a = "a", b = "b"
What you want sounds like it could be handled by an array, but you'll have to turn a1,a2,...,a10 into an array.
Assuming a1,a2,...,a10 were in an array named a you could get what you want into an array called b by doing:
b = [''.join(doc(a_part)) for a_part in a]