Can someone help me with this python code?

Asked

Viewed 17 times

-1

I need to know the functionality of this python function so that it serves what it does and needs to transform it into the PHP programming language.

 def word_to_int(word):
    value = 0
    exp = 1
    for i in range(0, 8):
        if word[i] == 1:
            value += exp
        exp *= 2
    return value

Does anyone know what this Python code does need to turn it into PHP ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.