Q. What is true about instance methods in Python?

  • (A) They do not take any parameter
  • (B) They are called on class, not on object
  • (C) They must have `self` as the first parameter
  • (D) They cannot modify object state
πŸ’¬ Discuss
βœ… Correct Answer: (C) They must have `self` as the first parameter
Explanation: Instance methods must include `self` to refer to the calling object.
Explanation by: Mr. Dubey
Instance methods must include `self` to refer to the calling object.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
84
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
99%
Success Rate