🔥 Welcome to my blog! Latest updates available now. Visit daily! 🔥 🔥 Click Here for Latest Updates – Visit My Blog 🔥
🔥 Latest Updates 📊 GP Grade Finder 📢 Government Services Info 🆕 New Schemes Updates

bytes Data Type in Python

 -->bytes data type represents a group of byte numbers just like an array.


Example

>>>x=[10,20,30,40]

>>>b = bytes(x)

>>>type(b)#bytes

>>>print(b[0])#10 

>>>print(b[-1])#40

>>> for i in b : print(i)#20 30 40 10


Conclusion 1:

-->The only allowed values for byte data type are 0 to 256.

-->By mistake if we are trying to provide any other values then we will get value error.


Conclusion 2:

-->Once we creates bytes data type value, we cannot change its values, otherwise we will get TypeError.

Example

>>> x=[10,20,30,40]

>>> b=bytes(x)

>>> b[0]=100#TypeError: 'bytes' object does not support item assignment

No comments:

Post a Comment

Thank you Very Much.For Given Comment

à°†ంà°§్à°°à°ª్à°°à°¦ేà°¶్‌à°²ో సదరం సర్à°Ÿిà°«ిà°•ేà°Ÿ్ à°•ోà°¸ం à°Žà°¦ుà°°ుà°šూà°¸్à°¤ుà°¨్à°¨ à°¦ిà°µ్à°¯ాంà°—ులకు à°¸్à°²ాà°Ÿ్ à°¬ుà°•ింà°—్ à°…à°ª్‌à°¡ేà°Ÿ్.

à°‡ంతకుà°®ుంà°¦ు వరకు SADAREM Slot Booking à°ª్à°°à°•్à°°ిà°¯ à°¸్వర్à°£ à°—్à°°ాà°®ం à°¸్వర్à°£ à°µాà°°్à°¡ు à°¦్à°µాà°°ా à°®ాà°¤్à°°à°®ే à°…ంà°¦ుà°¬ాà°Ÿుà°²ో à°‰ంà°¡ేà°¦ి. à°ª్à°°à°¸్à°¤ుà°¤ం à°ª్రజలకు మరింà°¤ à°¸ౌà°•à°°్యవం...