May-03-2022, 03:00 AM
a_subj
starts as a 1-element list. It gets t-1
extra elements as it goes through the for j in range(1, t)
loop.So if t is 3 or less, there will be 3 or less elements in a_subj. Then when you get to the print() statement, the request to print a_subj[3] will fail, since that index doesn't exist.
You are printing out the value of a_subj on line 21. What is the value?