πŸ“Š Python
Q. What is the output of this code?
Code:
class A:
    def __init__(self):
        self.value = 10

obj = A()
print(obj.value)
  • (A) 0
  • (B) 10
  • (C) None
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 10

Explanation: The `__init__` method sets `value` to 10.

Explanation by: Mr. Dubey
The `__init__` method sets `value` to 10.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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