Answer:
theSum = 0.0#defined in the question.
count=0 #modified code and it is used to intialize the value to count.
data = input("Enter a number: ") #defined in the question.
while data != "": #defined in the question.
number = float(data) #defined in the question.
theSum += number #defined in the question.
data = input("Enter the next number or press enter to quit ") #defined in the question "only some part is modified"
count=count+1#modified code and it is used to count the input to print the average.
print("The sum is", theSum)#defined in the question.
print("The average is", theSum/count) #modified code and it is used to print the average value.
output:
Explanation: