Cannot get results to display in python app
Question: What I am trying to do is write a program that reads the numbers in a text
file, displays the numbers and then displays the total of all the numbers in
the file and lists the numbers in the file

    
    
    '''
    This program should total the random numbers you generated in the numbers.txt file and
    then list them and give a total of the numbers
    '''  
    import random
    
    def main():
        # open random number file
        number_file = open('numbers.txt', 'r')
    
        # initialize an accumulator
        total = 0.0
    
         #  Initialize a variable to keep count of the numbers
        count = 0
    
        # Get the values of the number file 
        for line in number_file:
    
            # convert a line to a float
            rand_number = float(line)
    
            # add 1 to the count variable
            count += 1
    
            # Add the time to total
            total += rand_number
    
        # Close the file
        number_file.close()
    
        print('The total of the numbers is ', total)
        print('There were' count + ' records')
    
    # call main function
    main()
    

I cannot get it to display the numbers nor give me the totals. What do I need
to correct to get this to do what I want it to do?


Answer: try

    
    
        print('There were ' + str(count) + ' records')
    

