Share your repls and programming experiences

← Back to all posts
My
Edokati1 (0)

Reverse bits of a positive integer number in Python. Convert integer number into it's binary representation using bin(num) function. bin() function appends 0b as a prefix in binary representation of number, skip first two characters of binary representation and reverse remaining part of string.