I would like to be able to display or print a count of the number of names that were inputted and display this when the user gets out of the loop by pressing any key other than "y".
For example: Number of patients processed : 4
How could I create a counter and where does this counter need to be inserted into the following code.
Thank you
def main():
again = 'y'
while again =='y':
total = 0.0
results = []
print
name = raw_input("Enter Patients Name: ")
num_test = input("Enter number of test to average: ")
for x in range(num_test):
test = input("Enter Glucose Meter Reading: ")
results.append(test)
for value in results:
total += value
average = total / len(results)
print
print 'Average test result: ',average
again = raw_input('Add another Patient ' + \
'(Enter y for yes): ')
main()