[Python] Integer to Binary Query Using Bitwise Operations [closed]

Discussão em 'Python' iniciado por Stack, Maio 1, 2025.

  1. Stack

    Stack Membro Participativo

    Someone please explain how this determines a binary value from a decimal using bit shifting appropriately in python. Why would I use it?

    binaryValue = ' '

    for i in range(7, -1, -1):
    string += str((Number // (2 ** i)) % 2)
    result += binaryValue

    Continue reading...

Compartilhe esta Página