<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toBCD (n):
 """Converts the number n into Binary Coded Decimal."""

    bcd  = 0
    bits = 0

    while True:
        n, r  = divmod(n, 10)
        bcd  |= (r << bits)
        if n is 0:
            break
        bits += 4

    return bcd