title: How to make a simple calculator that includes the math.pow function. the math.pow function throws error
body: <p>My code is :</p>
  
  <pre><code>
  from flask import Flask, render_template, request , url_for
  import math
  
  app = Flask(__name__)
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  @app.route('/', methods = ['POST', 'GET'])
  
  def calcualtor ():
      if request.method == 'POST':
          a = int(request.form['first_number'])
          b = request.form['operator']
          c = int(request.form['second_number'])       
          result = 0.0
  
          if  b == '+' :
              result = (a+c)
              return render_template('index.html', result = result)     
          elif b == '-' :
              result = (a-c)
              return render_template('index.html', result = result)
          elif b == '*' :
              result = (a*c)
              return render_template('index.html', result = result)
          elif b == '/' :
              result = (a/c)
              return render_template('index.html', result = result)  
          elif  b == '^' :
              result = math.pow(a,b)
              return render_template('index.html', result = result)
  
      return
  
  </code></pre>
  
  <p>Other all parts such as addition, subtraction do work as expected but the math.pow doesn't like to work. Is there anything that I am doing wrong?</p>
  
  <p>The index.html file has a simple h1{{ result }} to display the result</p>
  
  <p>The error screen is:</p>
  
  <pre><code>TypeError
  TypeError: must be real number, not str
  
  Traceback (most recent call last)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 2464, in __call__
  return self.wsgi_app(environ, start_response)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 2450, in wsgi_app
  response = self.handle_exception(e)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 1867, in handle_exception
  reraise(exc_type, exc_value, tb)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\_compat.py", line 39, in reraise
  raise value
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 2447, in wsgi_app
  response = self.full_dispatch_request()
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 1821, in handle_user_exception
  reraise(exc_type, exc_value, tb)
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\_compat.py", line 39, in reraise
  raise value
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
  rv = self.dispatch_request()
  File "C:\Users\User\Desktop\Python\env\Lib\site-packages\flask\app.py", line 1936, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Users\User\Desktop\Python\app.py", line 32, in calcualtor
              return render_template('index.html', result = result)
          elif b == '/' :
              result = (a/c)
              return render_template('index.html', result = result)
          elif  b == '^' :
              result = math.pow(a,b)
              return render_template('index.html', result = result)
  
      return
  
  
  TypeError: must be real number, not str
  </code></pre>
  
  <p>I am a beginner.</p>