to string of digits with the built-in str functionand then getting the length of the resulting string with len the end result is the number of digits str and len work on many object typesmore on both as we move along on pythons prior to and once you start experimenting with floating-point numbersyou're likely to stumble across something that may look bit odd at first glance print( repras code (pythons and struser-friendly the first result isn' bugit' display issue it turns out that there are two ways to print every object in python--with full precision (as in the first result shown here)and in user-friendly form (as in the secondformallythe first form is known as an object' as-code reprand the second is its user-friendly str in older pythonsthe floating-point repr sometimes displays more precision than you might expect the difference can also matter when we step up to using classes for nowif something looks oddtry showing it with print built-in function call statement better yetupgrade to python and the latest xwhere floating-point numbers display themselves more intelligentlyusually with fewer extraneous digits--since this book is based on pythons and this is the display form 'll be showing throughout this book for floating-point numbers repras code (pythons > and besides expressionsthere are handful of useful numeric modules that ship with python--modules are just packages of additional tools that we import to useimport math math pi math sqrt( the math module contains more advanced numeric tools as functionswhile the ran dom module performs random-number generation and random selections (herefrom python list coded in square brackets--an ordered collection of other objects to be introduced later in this import random random random( random choice([ ] python also includes more exotic numeric objects--such as complexfixed-precisionand rational numbersas well as sets and booleans--and the third-party open source introducing python object types