The use of type()

^Bart gabriele1NOSPAM at hotmail.com
Sun Feb 10 16:42:57 EST 2019


I need to print something like "this variable is int" or "this variable 
is string"

n1 = 10
n2 = 23

print ("Total of n1+n2 is: ",n1+n2," the type is", type(n1+n2))

When I run it I have:

Total of n1+n2 is:  33  the type is <class 'int'>
 >>>

I'd like to read "the type is int" and NOT "the type is <class 'int'>, 
how could I solve it?

^Bart


More information about the Python-list mailing list