Skip to content

Commit

Permalink
Merge pull request #12 from Shrimad-Bhagwat/main
Browse files Browse the repository at this point in the history
Add Python file
  • Loading branch information
amansharma2910 authored Oct 4, 2021
2 parents 1a3e481 + 65fb847 commit 216fa2b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Shrimad-20BCG10003.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'''
@ Shrimad Bhagwat 20BCG10003
Program to Convert Integer to Binary
'''
def binary(num):
while (num > 0):
temp = num % 2
bin_no.append(temp)
num = num // 2
bin_no = []
n = int(input("Enter a number : "))
binary(n)
print("The binary of ",n," is ",end=" ")
for i in range (1,len(bin_no)+1):
print(bin_no[-i],end="")

0 comments on commit 216fa2b

Please sign in to comment.