Python 養成好習慣

 PEP8 Guidelines.

You should limit each line of code to 80 characters. 

The Python Style Guide recommends using 4 spaces to indent, rather than using a tab.


Docstrings are surrounded by triple quotes. The first line of the docstring is a brief explanation of the function's purpose.

def population_density(population, land_area):
    """Calculate the population density of an area. """
    return population / land_area


Good 

print(4 + 5)

留言

熱門文章