Counting Lines and numbering them
<p>Another question.</p>

<p>This program counts and numbers every line in the code unless it has a hash tag or if the line is empty.  I got it to number every line besides the hash tags.  How can I stop it from counting empty lines? </p>

<pre><code>  def main():

    file_Name = input('Enter file you would like to open: ')

    infile = open(file_Name, 'r')

    contents = infile.readlines()
    line_Number = 0
    for line in contents:
        if '#' in line:
            print(line)
            if line == '' or line == '\n':
                print(line)
        else:
            line_Number += 1 
            print(line_Number, line)

    infile.close()

main()
</code></pre>
