ONE and ZERO.The basis of this project is in this video -> links to his code can be found in descriptionIn it the speaker asks you to check his math; I wrote my own code and then compared it against his.It is also in the other GIST i am adding to stack-exchange -> Credit for that code goes to MATT PARKER.TL;DR This code loops through all the numbers between 0 and the value in maximum it calculates how many letters are in the binary form of the word One or Zero -> 13 (1101) and 18 (10010) are the only two values if spelled with the number of letters it equals its value! In this all variables loop around until they reach either 13 or 18 (explained in video) I counted how many of them go to either 18 (99.9909%) or 13 (the rest). Please rate my code and how efficient it is: especially as compared to the original code and also how it can be improved!Code My code is in main.py and his is in binarychain.py#Creating VariablesCount18 = 0Count13 = 0#Change maximum if you don't want to break your computermaximum = 1000000#Iterates over each letter and adds to a variable called letter for each letter in one -> 3 or Zero -> 4def letters(position=0):    letter = 0    binary = str('{0:b}'.format(position))    for ch in binary:        if ch == '1':            letter += 3        if ch == '0':            letter += 4    return int(letter)#Checks if the number reaches 13 or 18def check(number=0):    global Count13    global Count18    if number == 13:        Count13 += 1        return 0    if number == 18:        Count18 += 1        return 0    if number != 13 or 18:        return numberrunning = Truecounter = 0while running:    checker = check(letters(counter))    if checker == 0:        pass    else:        #Loops through over and over again until a number reaches either 13 or 18        while checker != 0:            checker = check(letters(checker))    #I could have used a for loop but it just wasn't working with this :(    counter += 1    if counter > maximum:        running = False#Calcualtions for percentagePerCent18 = (Count18 / maximum)*100PerCent13 = (Count13 / maximum)*100print(\nCount 18:, Count18, PerCent18, Count13:, Count13, PerCent13)#Just incase it is not being run in an IDEinput()
Code to measure the length of binary numbers in terms of English nomenclature
python;python 3.x;mathematics