Q. What is the output?
```python
class A:
x = 10

a = A()
b = A()
a.x = 20
print(b.x)
```

  • (A) 10
  • (B) 20
  • (C) Error
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10
Explanation: Changing `a.x` creates an instance variable that does not affect the class variable `x`.
Explanation by: Mr. Dubey
Changing `a.x` creates an instance variable that does not affect the class variable `x`.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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