<jupyter_start><jupyter_text>Binary to Decimal and Back ConverterDevelop a converter to convert a decimal number to binary or a binary number to its decimal equivalent.<jupyter_code>def binary_decimal_calculator(target, number):    
    if target.lower()[0] == "b":  
        power = 0
        binary_number = ""
        while number >= 2**power:
            power += 1
        for n in range(power)[::-1]:
            if number >= 2**n:
                binary_number += str(number // 2**n)
                number = number % 2**n
            else:
                binary_number += "0"                
        result = int(binary_number)
    if target.lower()[0] == "d":        
        decimal_number = 0        
        for i, n in enumerate(range(len(str(number)))[::-1]):            
            decimal_number += int(str(number)[i]) * 2**n            
        result = decimal_number
    return result       
binary_decimal_calculator("b",1)
binary_decimal_calculator("b",2)
binary_decimal_calculator("b",3)
binary_decimal_calculator("b",65000)
binary_decimal_calculator("d",1)
binary_decimal_calculator("d",10)
binary_decimal_calculator("d",11)
binary_decimal_calculator("d",1111110111101000)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1198044009779951, 'fraction_numerical': 0.034229828850855744, 'mean_word_length': 2.5594202898550726, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '188485', 'license': 'MIT', 'n_tokens_mistral': 411, 'n_tokens_neox': 370, 'n_words': 79, 'path': 'mk012-project_bin_dec_converter.ipynb', 'repo_name': 'karakose77/complete-python-bootcamp-exercises-and-projects', 'size': '1227'}