Code:
class abc():
def __init__(self,x):
pass
a = abc(2)
print(a)
Desired OP:
2
Current OP:
<__main__.abc object at 0x000002736F8D7128>
How to get some data when an object is called instead of the default message about the object location
The same way when:
import numpy as np
a = np.array([1,2,3])
print(a)
Gives OP
[1 2 3]