Write a program in python program to find sum or product when you press s it will find sum and when you will press p find product.if you entered other character it will print you entered wrong character.ch value is not comparing with s or p.error s is not defined
a = input("enter a number\n")
b = input("enter a number\n")
c = input("enter a number\n")
print "enter s for sum and p for product"
ch = input("enter character")
if(ch=='s'):
s = a+b+c
print "the product of the number:" +s
elif(ch =='p'):
p = a*b*c
print "the product of the number:" +p
else:
print "entered invalid character"
This code giving
Name error: name 's' is not defined