Implement the algorithm through which non-negative integers are reduced to zero. For each non-negative integer supplied, count the number of operations performed by the algorith to reduce the number to zero.
class Solution:
def numberOfSteps (self, num: int) -> int:
number_of_steps = 0
while not num == 0:
number_of_steps += 1
if num % 2 == 0:
num /= 2
else:
num -= 1
return number_of_steps