Module: Bit Operations (Python)


Problem

10/13

Function

Problem

There is a function that takes a natural number. The function sets all bits of this number to zero, except for the least significant one and returns the result in decimal notation.
Implement this function.
 
For example
Given the number 40(10) = 101000(2)
The function turns it into 1000(2) = 8(10)

(c) Kurbatov E., 2017