Froquiz
Home
Quizzes
Job Tracker
Senior Challenge
Get Certified
Blog
🇬🇧
en
Sign In
Start Quiz
🇬🇧
en
Sign In
Start Quiz
Loading...
Quiz Topics
1
2
3
4
5
6
7
8
9
10
01
/ 10
When are __getitem__ and __setitem__ methods called in Python?
Auto Skip
Report Issue
A.
obj[key] -> __getitem__; obj[key] = value -> __setitem__; custom class supports [] operator
B.
__getitem__ is only called for list
C.
__getitem__ and __setitem__ must be defined together
D.
__setitem__ only works in dict classes
Previous
Next