LGA-03: Python Style¶
You can complete this LGA individually, or as a group (if you meet up outside of class). It’s up to you and your group.
Read the Python Style Guide (PEP 8). Note down a few things that intrigue you, you think are a good idea, or you’re not sure why they are a style requirement. Then, provide answers the following questions:
- What are some advantages of an official language style guide? Disadvantages?
- What does the style guide mean by “A Foolish Consistency is the Hobgoblin of Little Minds”?
- Python allows you to use either parentheses or a backslash to continue a line. When might one be more appropriate than the other? Support your answer with examples.
- Should
camelCase
ever be used in Python? - What is a “docstring”? Give an example of a function with a docstring.
- Name one style habit you’ll have to break while coding in Python.