#Write a program that reads a sequence of non-zero integers. First zero #value will terminate the input. The program finds and prints the number #or inputs, their sum and average. #Solution with Functions: def process(): count=0 sum=0 #we have to read first input BEFORE the loop so we can use the condition #of non-zero inputs num=int(input("enter non-zero integer ")) while(num!=0): count=count+1 sum=sum+num num=int(input("enter non-zero integer ")) if(count>0): average=sum/count return count, sum, average else: return count, -1, -1 def main(): count, sum, average=process() if(count==0): print("no inputs") else: print(count, sum, average) main()