the problem is
if value >= list[j]:
numOfComp += 1
j = j - 1
If value >= list[j]
you can and should simply exit your while loop and stop further comarisons
Also you are repeating the comparisons twice See the following refined code
def insertionSort(list):
numOfComp = 0
for i in range(1,len(list)):
value = list[i]
j = i - 1
while j>=0:
if value<list[j]:
flag=True
else :
flag=False
numOfComp += 1
if flag:
list[j+1] = list[j]
list[j] = value
j = j - 1
else:
break
print("Number of data comparisons:",numOfComp)
print("Sorted list:",list)