Creating a list

Can someone teach me what is going on in these last two codes…?

sign = [1,1,1]
n = 10

res = sign[:n]
for i in range(n - 3): res.append(sum(res[-3:]))