Python3 conversion between hex

Python3 conversion between hex

  In Python Inside conversion between hex it is very convenient, there is a special function to perform this operation:

  Directly below the Code:

# Between binary conversion 
A = 10 # into a binary Print (bin (A))
 # result 0b1010 # octal Print (OCT (A))
 # result 0o12 # octal Print (hex (A) )
 # result 0xA # a non-decimal number is converted to decimal Print (int (0b1010))
 # result 10











  

Guess you like

Origin www.cnblogs.com/xdtg/p/11403477.html