threadimport decimal decimal decimal( decimal decimal( decimal(' 'default digits decimal getcontext(prec decimal decimal( decimal decimal( decimal(' 'fixed precision decimal( decimal( decimal( decimal( decimal(' - 'closer to this is especially useful for monetary applicationswhere cents are represented as two decimal digits decimals are essentially an alternative to manual rounding and string formatting in this context this has more digits in memory than displayed in decimal getcontext(prec pay decimal decimal(str( )pay decimal(' 'decimal context manager in python and and laterit' also possible to reset precision temporarily by using the with context manager statement the precision is reset to its original value on statement exitin new python session (per the here is python' interactive prompt for continuation lines in some interfaces and requires manual indentationidle omits this prompt and indents for you) :\codec:\python \python import decimal decimal decimal(' 'decimal decimal(' 'decimal(' 'with decimal localcontext(as ctxctx prec decimal decimal(' 'decimal decimal(' 'decimal(' 'decimal decimal(' 'decimal decimal(' 'decimal(' 'though usefulthis statement requires much more background knowledge than you've obtained at this pointwatch for coverage of the with statement in because use of the decimal type is still relatively rare in practicei'll defer to python' standard library manuals and interactive help for more details and because decimals other numeric types