l=[1,7,3,9,8] a=[[]] for i in range(len(l)+1): for j in range(i): a.append(sum(l[j:i])) print(a) count=0 for i in range(1,len(a)): if(a[i]&1): count+=1 print(count)
To embed this program on your website, copy the following code and paste it into your website's HTML: