Horje
Binary to decimal in Python without inbuilt function Code Example
Binary to decimal in Python without inbuilt function
binary_num = int(input("Enter the Binary Number: "))
dec_num = 0
m = 1
length = len(str(binary_num))

for k in range(length):
    reminder = binary_num % 10
    dec_num = dec_num + (reminder * m)
    m = m * 2
    binary_num = int(binary_num/10)

print("Equivalent Decimal Value = ", dec_num)




Python

Related
no module named 'flask_jwt_extended' Code Example no module named 'flask_jwt_extended' Code Example
add months to date python Code Example add months to date python Code Example
import NoSuchKey in boto3 Code Example import NoSuchKey in boto3 Code Example
python selenium canvas fingerprinting Code Example python selenium canvas fingerprinting Code Example
clear anaconda cache Code Example clear anaconda cache Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7