Module (45%)
Section (45%)

The same information stored in __class__could be retrieved by calling a type() function with one argument:

for element in (1, 'a', True): print(element, 'is', element.__class__, type(element))

The results are:

1 is <class 'int'> <class 'int'> a is <class 'str'> <class 'str'> True is <class 'bool'> <class 'bool'>

output


Code

for element in (1, 'a', True):
print(element, 'is', element.__class__, type(element))
{{ dockerServerErrorMsg }} ×
{{ errorMsg }} ×
{{ successMsg }} ×