Function to calculate power of 3
def calculate ( bit_cnt ) : NEW_LINE INDENT res = 1 ; NEW_LINE while ( bit_cnt > 0 ) : NEW_LINE INDENT bit_cnt -= 1 ; NEW_LINE res = res * 3 ; NEW_LINE DEDENT return res ; NEW_LINE DEDENT