Dec-03-2019, 12:57 AM
Yes. You can always use the type function to test that.
Examples (Out[10] is the output for the line of code above it):
Examples (Out[10] is the output for the line of code above it):
from decimal import Decimal 2/5 Out[10]: 0.4 type(2/5) Out[11]: float Decimal(2/5) Out[12]: Decimal('0.40000000000000002220446049250313080847263336181640625') type(Decimal(2/5)) Out[13]: decimal.Decimal 2//5 Out[14]: 0 type(2//5) Out[15]: int