Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Python/program-19/program.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Python Program to Convert Decimal to Binary

def decimalToBinary(num):
"""This function converts decimal number
to binary and prints it"""
if num > 1:
decimalToBinary(num // 2)
print(num % 2, end='')


# decimal number
number = int(input("Enter any decimal number: "))

decimalToBinary(number)
1 change: 1 addition & 0 deletions Python/program-19/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Program to convert Binary to Decimal