num=int(input("enter non zero, zero will stop the input ")) sum=0 counter=0 while(num!=0): if(num<0): sum=sum+num counter=counter+1 num=int(input("enter non zero, zero will stop the input ")) if(counter>0): print("sum of negatives",sum) print("number of negatives",counter) print("average of negatives",sum/counter) else: print("no negatives")