Here’s the Brief description about the Python OO Features and Other useful Features
• Encapsulation
- By default all class members are public always
- To give private scope to a members, use ’__varname’
• Inheritance
- Supports multiple inheritance
• Overriding attributes
• Examples
Other useful Features
• array : (100,200,300)
• Lists : [42,”Hello”,3.1]
• dictionary : {‘x’:42, ‘y’:3.1}
• Indexing:
L=[1,2,3,4]
L[0] – 1, L[3] – 4
Negative numbers for indexing
L[-1] – 4 (last item)
• Slicing a sequence:
L[1-2] — 2,3