two notes before moving on firstper the start of this python users should remember that you can code octals with simply leading zerothe original octal format in python ( ( new octal format in (same as xold octal literals in all (error in xin xthe syntax in the second of these examples generates an error even though it' not an error in xbe careful not to begin string of digits with leading zero unless you really mean to code an octal value python will treat it as base which may not work as you' expect-- is always decimal in xnot decimal (despite what you may or may not think!thisalong with symmetry with the hex and binary formsis why the octal format was changed in --you must use in xand probably should in and both for clarity and forward-compatibility with secondlynote that these literals can produce arbitrarily long integers the followingfor instancecreates an integer with hex notation and then displays it first in decimal and then in octal and binary with converters (run in herein the decimal and octal displays have trailing to denote its separate long typeand octals display without the letter ) xffffffffffffffffffffffffffff oct( ' bin( ' and so on speaking of binary digitsthe next section shows tools for processing individual bits bitwise operations besides the normal numeric operations (additionsubtractionand so on)python supports most of the numeric expressions available in the language this includes operators that treat integers as strings of binary bitsand can come in handy if your python code must deal with things like network packetsserial portsor packed binary data produced by program we can' dwell on the fundamentals of boolean math here--againthose who must use it probably already know how it worksand others can often postpone the topic altogether--but the basics are straightforward for instancehere are some of python' bitwise expression operators at work performing bitwise shift and boolean operations on integersx < decimal is in bits shift left bits numbers in action