Back to Discover
💻 Program of Thoughts
Template to generate the code portion of the Program of Thoughts (PoT) prompting method
Prompt
# Question: {{ Question }}
# Answer this question by implementing a solver() function.
def solver():
# Let's write a Python program step by step, and then return the answer
# Step 1: Define the given variables
[variable_1] = [value_1]
[variable_2] = [value_2]
...
# Step 2: Perform intermediate calculations
[intermediate_variable_1] = [calculation_1]
[intermediate_variable_2] = [calculation_2]
...
# Step 3: Calculate the final answer
[final_answer] = [final_calculation]
return [final_answer]
# Example usage:
print(solver())