---
title: "Discussion on \"bytes() function in Python\" | Hashnode"
description: "Discussion on \"bytes() function in Python\". Introduction\nThe bytes() function returns an immutable bytes object initialized with the given size and data. You can call it as an immutable version of the bytearray() function.\nThe syntax of bytes() function is:\nbytes(source, encoding, errors)\n\nwhe..."
url: "https://hashnode.com/posts/bytes-function-in-python/634467b06d64be07a724b022"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [bytes() function in Python](https://blog.ashutoshkrris.in/bytes-function-in-python?utm_source=hashnode&utm_medium=feed)

Introduction The bytes() function returns an immutable bytes object initialized with the given size and data. You can call it as an immutable version of the bytearray() function. The syntax of bytes() function is: bytes(source, encoding, errors) whe...

Oct 10, 2022 · 2 min read · blog.ashutoshkrris.in  
Updated Mar 18, 2023  
Read the article

-   [#beginner](https://hashnode.com/tag/beginner)

## Written by

[Ashutosh Krishna](https://hashnode.com/@ashutoshkrris)

@ashutoshkrris · Bengaluru, India

  
[View profile](https://hashnode.com/@ashutoshkrris)

Building reliable software with Java, Spring Boot, Python, and the web

Software Engineer at OpenText passionate about building scalable web applications and backend systems. I work mainly with Java, Spring Boot, Python, and modern web technologies. I enjoy creating things for the internet, exploring new tech, and sharing what I learn along the way.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
