Lecture Note
University
American Baptist CollegeCourse
CSCI 1534 | Data Analysis and VisualizationPages
2
Academic year
2023
Muthia Marhamah
Views
0
Document Code Segment Indentation Python uses four spaces as default indentation spaces. However, the number of spaces can be anything; it is up to the user. But a minimum of one space is needed to indent a statement. The first line of python code cannot have an indentation. For example: Comment Comment is Python is identified with a hash symbol, #, and extend to the end of the line. Hash characters in a string are not considered comments, however. There are three ways to write a comment - as a separate line, beside the corresponding statement of code, or as a multi-line comment block. For example:
Document String Python documentation strings (or docstrings) provide a convenient way of associating documentation with python modules, functions, classes, and methods. What should a docstring look like? The doc string line should begin with a capital letter and end with a period The first line should be a short description The second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects., etc. For example:
Document Code Segment
Please or to post comments