Python: What is a header?

前端 未结 6 811
深忆病人
深忆病人 2021-01-31 11:16

I\'m new to Python and programming in general. I am taking a module at university which requires me to write some fairly basic programs in Python. However, I got this feedback o

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 12:01

    A header block are just comments at the top of the code. It doesn't print when the program runs.

    A example could look like the following:

    # File name: test.py
    # Author: Peter Test
    # Date created: 4/20/2013
    # Date last modified: 4/25/2013
    # Python Version: 2.7
    
    # Begin code
    
    a = 1
    b = 2
    
    c = a + b
    
    print c
    

提交回复
热议问题