---
title: "Discussion on \"bin() function in Python\" | Hashnode"
description: "Discussion on \"bin() function in Python\". Introduction\nThe bin() function converts and returns the binary equivalent string of a given integer. If the parameter isn't an integer, it has to implement __index__() method to return an integer.\nThe syntax of bin() method is:\nbin(num)\n\nwhere num i..."
url: "https://hashnode.com/posts/bin-function-in-python/6344629bf943840715bd23da"
---

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

Discussion

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

Introduction The bin() function converts and returns the binary equivalent string of a given integer. If the parameter isn't an integer, it has to implement \_\_index\_\_() method to return an integer. The syntax of bin() method is: bin(num) where num i...

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

-   [#100daysofcode](https://hashnode.com/tag/100daysofcode)
-   [#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.
