You can learn about Introduction to Python Programming Programs with Outputs helped you to understand the language better.
Python Programming – Python Style Rules and Conventions
summarizes the list of some of the Python style rules and conventions.
- Python Programming – How To Start Python
- Python Style Rules
- Introduction to Python Programming – Interpreter
Elements | Description |
Semicolons | The Python statement written in the form of a sentence must not be terminated with semicolons. Semicolons should not be used as separators to put two commands on the same line. |
Line length | The line length should be of maximum 79 characters if you use Python. |
Indentation | In Python, indentation is used to form suites, i.e., block of statements, and it is treated as a unit. The code blocks are indented with spaces. |
Blank Lines | The two blank lines should be between top-level definitions, and one blank line should be between method definitions. |
Whitespace | Standard typographic rules are used for spaces around punctuation. |
Comments | The right style for module, function, method, and in-line comments should always be used. |
Statements | Generally, only one statement per line should be written. |
Case Sensitive | Python is case sensitive, i.e., it treats upper and lower case characters differently. Therefore, case of statement is very important. Always be careful while declaring code and identifier names. |
Recommended Reading On: Python Program to Check Whether Triangle is Valid or Not if Sides are Given