Advertisement
Identifiers | Convention |
---|---|
Variable Name | A variable name should be in lowercase and a multiple word variable name is separated by underscore (_). |
Function Name | A function name should be in lowercase alphabets and a multiple word variable name is separated by underscore (_) . |
Class Name | A class name should be in CamelCase(where every first alphabet of a word is in uppercase, with no space or underscore in between multi-word class name. |
Module Name | A module name should be in lowercase alphabets and a multi-word module name could be separated by an underscore (_). |
Module Constant | A module constant should be in uppercase alphabets, where multi-word constant names are separated by an underscore(_). |
# Python - Valid identifiers following naming conventions
size = 1000;
ink_price = 9.59;
string1 = 'a'
String1 = 'Have a beautiful life and keep smiling!'
print('Value referenced by variable size is : ', size)
print('Value referenced by variable ink_price is : ', ink_price)
print('Value referenced by variable string1 is : ', string1)
print('Value referenced by variable string2 is : ', String1)
Value referenced by variable size is : 1000
Value referenced by variable ink_price is : 9.59
Value referenced by variable string1 is : a
Value referenced by variable string2 is : Have a beautiful life and keep smiling!
Advertisement
keywords | keywords | keywords | keywords |
---|---|---|---|
False | None | True | and |
class | continue | del | def |
global | for | from | finally |
is | lambda | nonlocal | not |
with | while | return | try |
as | elif | if | yield |
or | assert | else | import |
pass | break | except | in |
raise |
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement