as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
generate an algorithm to calculate the power of a number
user
the following algorithm can be used to calculate the power of a number: 

1. take two inputs, a base number and an exponent
2. initialize a variable result and set it to 1
3. start a loop from 1 to exponent 
    a. multiply result with the base number
4. print result
assistant