<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described.
<END_TASK>
<USER_TASK:>
Description:
Return 2^n modulo p (be aware of numerics).
    
This is how the function will work:
 modp(3, 5)
    3
    
This is how the function will work:
 modp(1101, 101)
    2
    
This is how the function will work:
 modp(0, 101)
    1
    
This is how the function will work:
 modp(3, 11)
    8
    
This is how the function will work:
 modp(100, 101)
    1
    
<ASSISTANT_TASK:>
Python Code:
def modp(n: int, p: int):
    
    ret = 1
    for i in range(n):
        ret = (2 * ret) % p
    return ret
<END_TASK>