I have a question regarding this piece of code, which transforms the elements of TexMobject (for example, element 2 is transformed to 8, 3 is transformed to 9 and so on):
changes = [
[(2,4,3), (8,11,9)],
[(0,0), (7,10)]
]
for pre_ind, post_ind in changes:
self.play(
*[
ReplacementTransform(formula[i].copy(), formula[j])
for i,j in zip(pre_ind, post_ind)
]
)
self.wait()
self.wait()
I see that there is a list comprehension used to generate indices pairs, but I don't understand why is there an args asterisk (*) before the square brackets in self.play()
? What is the purpose of using *args notation in this case, if list comprehension works without it?