- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to access Python objects within objects in Python?
The objects within objects can be accessed as follows
class P: def __init__(self): self.w = Q() class Q: def __init__(self): self.list = [3,4,5] def function(self): self.list = 7 y = P() f = [y] print f.w.function() print f.w.list
Gives output as
None [3, 4, 7]
- Access objects from the nested objects structure in MongoDB
- Python Code Objects
- How we can convert Python objects into JSON objects?
- How do you compare Python objects with .NET objects?
- Timer objects in Python
- Barrier Objects in Python
- File Objects in Python?
- How to create class objects in Python?
- Are Python functions objects?
- Inspect live objects in Python
- Creating Instance Objects in Python
- How does Python class inherit objects?
- How to retrieve source code from Python objects?