def calc(request):
if request.method == 'GET':
return render(request,'calc.html',locals())
elif request.method == 'POST':
if request.POST['x'] == '':
print('>>>>>>>>>')
x = int(request.POST.get('x','10'))
y = int(request.POST.get('y','20'))
op = request.POST.get('op')
if op == 'add':
ret = x+y
elif op == 'sub':
ret = x-y