Reputation: 91
The output for type(10) is int. The output for print(type(10)) is <class 'int'>.
Is there a way of printing only the datatype in Python?
Upvotes: 2
Views: 743
Reputation: 9619
You can get the __name__
attribute of the class:
print(type(10).__name__)
Output:
int
Upvotes: 3