<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:


def modp(n: int, p: int):
    """Return 2^n modulo p (be aware of numerics). 3 2 1 8 1 """
    ret = 1
    for i in range(n):
        ret = (2 * ret) % p
    return ret
