'NoneType' object is not callable for an object that has a value?

78 Views Asked by At

I have the following two lines of code:

print(test)
print(test.type())

There is something being printed out by the code, namely the value of test. However, when I check the type of test through test.type(), i get the error TypeError: 'NoneType' object is not callable. How is this possible?

1

There are 1 best solutions below

0
On BEST ANSWER

test.type is None.

Use type(test) instead.