binary - using python to convert integer to 8bit binarey -


im working on program converts binary integers (easy enough) need convert integers 8bit binary representation. have had look, , can mathematically, wondering if there handy python function did this?

to precisely 8 bits, use string formatting:

a demo:

>>> '{0:08b}'.format(22) '00010110' 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -