Python String Python Print Python Dictionary Python Function Python JSON Python List Python Math Python DateTime Python File Python Integer Python Loop Python Array Python Set Python OpenCV OpenCV Image Python Directory Python Error Python Float Python Module Python CSV Python Class Python Exception 最受...
在Python 中,你可以使用內建函式bin()來將一個整數轉換成二進位制。bin()函式將一個整數作為引數,並返回其等價的以0b為字首的二進位制字串。 下面是一個例子。 binary=bin(16)print(binary) 輸出: 0b10000 如上圖所示,一個整數的二進位制可以通過bin(x)方法簡單地得到。但如果想從其輸出中去掉0b字首...