What is __ getitem __?



What is __ getitem __?..

Answer / Saurabh

__getitem__ is a special method in Python classes that allows objects to be indexed like lists or arrays. When an object's [] operator is used, Python calls the __getitem__ method to retrieve the corresponding item.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How to import a module given the full path?

1 Answers  


Why do we use raw_input in python?

1 Answers  


What is raw string in python?

1 Answers  


Explain “with” statement in python?

1 Answers  


How do you debug a program in python? Answer in brief.

1 Answers  


What is raw_input?

1 Answers  


How to find whether string is alphanumeric or not?

1 Answers  


How can you profile a python script?

1 Answers  


How much ram is required for python?

1 Answers  


What is the function of negative index?

1 Answers  


What is the zip() function in python?

1 Answers  


What is a python template engine?

1 Answers  


Categories