|
88 | 88 | "- camelCase\n",
|
89 | 89 | "- CapWords\n",
|
90 | 90 | "\n",
|
| 91 | + "**Common Rules for Naming Convention**\n", |
| 92 | + "\n", |
| 93 | + "1. If an identifier starts with an underscore, then it is a private identifier\n", |
| 94 | + "2. Class names should normally use the CapWords convention. Exp: class BankAccount:\n", |
| 95 | + "3. Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.\n", |
| 96 | + "4. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.\n", |
| 97 | + "Function names should be lowercase, with words separated by underscores as necessary to improve readability. Exp: def withdrawal(): or def bank_withdrawal():\n", |
| 98 | + "\n", |
| 99 | + "5. Variable names follow the same convention as function names.\n", |
| 100 | + "```\n", |
| 101 | + "a=[1,2,3]\n", |
| 102 | + "d={‘a’:1}\n", |
| 103 | + "colors=[‘red’,’blue’]\n", |
| 104 | + "```\n", |
| 105 | + "6. Method names and also instance variables should be lowercase with words separated by underscores as necessary to improve readability.\n", |
| 106 | + "7. Use one leading underscore only for non-public methods and instance variables.\n", |
| 107 | + "\n", |
91 | 108 | "\n",
|
92 | 109 | "## Constants\n",
|
93 | 110 | "A `constant` is a special type of variable whose value cannot (is not) be changed. Exp: PI = 3.14\n",
|
|
0 commit comments