Consider the following code that takes input processes and their arrival times and sort them according to FCFS algorithm, so i\'ve been thinking about algorithms to compute avg
process_queue[i].append(int(list1[i])
you are appending the i'th element of list1 to the process_queue list , You should note that list1[i] is not a list but an integer . and in next line you are trying to access
total_wtime += process_queue[i][1]
1st element of the process_queue[i] but it is not a 2d array
total_wtime += process_queue[i]
should work .