in [ ] / out [ ] in [ ]out [ ] we see two alternative ways of writing itbut only the last way of writing it gave the correct ( expectedresultwhywith python version the first alternative gives what is called integer divisioni all decimals in the answer are disregardedso the result is rounded down to the nearest integer to avoid itwe may introduce an explicit decimal point in either the numeratorthe denominatoror in both if you are new to programmingthis is certainly strange behavior howeveryou will find the same feature in many programming languagesnot only pythonbut actually all languages with significant inheritance from if your numerator or denominator is variablesay you have /xyou may write /float(xto be on safe grounds python version implements mathematical real number division by and requires the operator /for integer division (/is also available in python version although python version eliminates the problems with unintended integer divisionit is important to know about integer division when doing computing in most other languages formatting text and numbers results from scientific computations are often to be reported as mixture of text and numbers usuallywe want to control how numbers are formatted for examplewe may want to write / as or - ( :  the print command is the key tool to write out text and numbers with full control of the formatting the first argument to print is string with particular syntax to specify the formattingthe so-called printf syntax (the peculiar name stems from the printf function in the programming language where the syntax was first introduced suppose we have real number an integer and text 'some messagethat we want to write out in the following two alternative waysreal= integer= string=some message real= + integer string=some message the real number is first written in decimal notation with three decimalsas but afterwards in scientific notation as + the integer is first written as compactly as possiblewhile on the second line is formatted in text field of width equal to five characters the following programformatted_print pyapplies the printf syntax to control the formatting displayed above