Beginning Zeros

Beginning Zeros

You have a string that consist only of digits. You need to find how many zero digits ("0") are at the beginning of the given string.

example

Input: A string (str), that consists of digits.

Output: An integer (int).

Examples:

assert beginning_zeros("100") == 0
assert beginning_zeros("001") == 2
assert beginning_zeros("100100") == 0
assert beginning_zeros("001001") == 2

Precondition: 0-9

40