A

Admin • 833K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 33
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Changing `a.x` creates an instance variable that does not affect the class variable `x`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.