title: I am making a calculator and this is returning null in all the cases
body: <p>This is views.py and the value of c is getting displayed on the browser as null. num1 is the name of my first html textbox. Num2 is the name of my Second html textbox</p>
  <pre><code> def calc(request):
          a=int(request.POST[&quot;num1&quot;])
          b=int(request.POST[&quot;num2&quot;])
          if 'add' in request.POST:    
              c=a+b
              return c
          if 'sub' in request.POST:    
              c=a-b
              return c   
          if 'mul' in request.POST:    
              c=a*b
              return c
          if 'div' in request.POST:    
              c=a/b
              return c
      
      def calprint(request):
          c=calc(request)
          return render(request,&quot;result.html&quot;,{&quot;result&quot;:c})
  </code></pre>
  <p>this is the HTML where the method is post</p>
  <pre><code> &lt;form action=&quot;calc&quot; method=&quot;POST&quot;&gt;
          {% csrf_token %}
         num 1 &lt;input type=&quot;text&quot; name=&quot;num1&quot;&gt;&lt;br&gt;
         num 2 &lt;input type=&quot;text&quot; name=&quot;num2&quot;&gt;&lt;br&gt;
         &lt;input type=&quot;submit&quot; value=&quot;add&quot;&gt;
         &lt;input type=&quot;submit&quot; value=&quot;sub&quot;&gt;
         &lt;input type=&quot;submit&quot; value=&quot;mul&quot;&gt;
         &lt;input type=&quot;submit&quot; value=&quot;div&quot;&gt;
      &lt;/form&gt;
  </code></pre>
  <p>This is the urls.py</p>
  <pre><code>urlpatterns = [
      path('',views.home,name='home'),
      path('calc',views.calprint,name='add')
  ]
  </code></pre>