** * ** if you expected for the second expressionremember exponentiation has even higher precedence than multiplication and division ** is * * or and * is exponents do not need to be integers useful example is the powerit produces square root try in the shell * * the result of power operation is of int type only if both parameters are integers and the correct result is an integer string formats for float precision you generally do not want to display floating point result of calculation in its raw formoften with an enormous number of digits after the decimal pointlike you are likely to prefer rounding it to something like there are two approaches first there is format function (not methodwith second parameter allowed to specialize the formatting of objects as strings read the following example interpreter sequence showing possibilities when float is being formattedx format( ' ' format( '' note that the results are rounded not truncatedthe result to two places is not the formatting string fmeans round to places after the decimal point similarly fmeans round to two decimal places warningthis format function returns the formatted string it does not change the parameters as complete statement in program format( ')is uselessthe ' gets returned and thrown awaywith no effect on the first versionsaving the formatted value to swill allow the formatted string to be used again (as sthis rounding notation can also be placed after colon inside the braces of format stringsfor use with the string format method you can put colon and the formatting information we used in the simple format method above (like but with no quotesrecall there are many ways to indicate what values to substitute into format string the first way introduced is just to omit any reference to the variables and substitute the method' parameters in order as inx ' long{ } short{ } { fformat(xxy' long short the first part inside the formatting braces can also indicate what value to substituteas when using dictionary 'long{ }short{ fformat(**locals()'long short decimalsfloatsand floating point arithmetic