bytes()

Built-in FunctionPython 2.0+Intermediate

Creates an immutable sequence of bytes

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
b = bytes([72, 101, 108, 108, 111])
print(b)
print(bytes("hello", "utf-8"))

bytes() is a built-in function that creates an immutable sequence of bytes.

Try in Playground

Tags

builtinfunctioncoredatatypebinaryimmutable

Related Items