Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

1)  code of

from django.shortcuts import render
from django.http import HttpResponse

def swapform(request):
if request.method=='POST':
a = int(request.POST["t1"])
b = int(request.POST["t2"])
if request.POST["ope"]=="swap":
a = a + b
b = a - b
a = a - b
return render(request,"swapapp/swa.html",{'k1':a,'k2':b,'k3':'cyan'})
return render(request,"swapapp/swa.html",{'k1':a,'k2':b,'k3':'orange','k4':c})
return render(request,"swapapp/swa.html")

2)  Code of swa.html

<!DOCTYPE html>
<body bgcolor="{{k3}}">
<form action="#" method="POST">
{% csrf_token %}

ENTER 1ST no.<input type="text" name="t1" value="{{k1}}"><br>
ENTER 2ND no.<input type="text" name="t2" value="{{k2}}"><br><br>
<input type="radio" name="ope" value="swap">SWAP
<input type="radio" name="ope" value="Add">Add
<button type="submit" name="btn">Click Here For Swapping</button>





POST Answer of Questions and ASK to Doubt

  1. Right away I am ready to do my breakfast, afterward having my
    breakfast coming over again to read other news.


Post a Comment

POST Answer of Questions and ASK to Doubt

Previous Post Next Post