W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
Python bytearray() 方法返回一個新字節(jié)數(shù)組。這個數(shù)組里的元素是可變的,并且每個元素的值范圍: 0 <= x < 256。
bytearray()方法語法:
class bytearray([source[, encoding[, errors]]])
返回新字節(jié)數(shù)組。
以下實例展示了 bytearray() 的使用方法:
>>>bytearray()
bytearray(b'')
>>> bytearray([1,2,3])
bytearray(b'\x01\x02\x03')
>>> bytearray('school', 'utf-8')
bytearray(b'school')
>>>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: