Contact: aviboots(AT)netvision.net.il
41,683 questions
54,351 answers
573 users
# bit_length() - Return the number of bits necessary to represent an integer in binary, # excluding the sign and leading zeros: n = -58 print(bin(n)) print(n.bit_length()) ''' run: -0b111010 6 '''