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 = []
        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: ")
        for value in results:
            total += value
            average = total / len(results)
        print 'Average test result: ',average
        again = raw_input('Add another Patient ' + \
        '(Enter y for yes): ')

You would want to initialize the counter to 0 before your while loop like my_count = 0 and then near the end of the loop contents you can add a my_count += 1 (which is equivalent to my_count = my_count + 1 )

Soved it easily
This question has already been answered. Start a new discussion instead.