Thank you alot for all your help till now, as i am new to python as well new to programming, please guide me to be on right track.

Here is my problem,i have a function i named it as Math(), i perform some arithmetic operation and print its result, here is my code :

- Code: Select all
`import math`

def Math(x1,y1):

a = x1+y1

b = x1-y1

c = x1*y1

d = x1/y1

while True:

e1 = raw_input("which number you want for square x or y: ")

if e1 == 'x':

e = x1**2

break

elif e1 == 'y':

e = y1**2

break

else:

e1 = raw_input("please enter the valid entry x or y :")

while True:

f1 = raw_input("which number you want for square root x or y: ")

if f1 == 'x':

f = math.sqrt(x1)

break

elif f1 == 'y':

f = math.sqrt(y1)

break

else:

f1 = raw_input("please enter the valid entry x or y :")

print "additin is: ", a

print "subtraction is:", b

print "multiplication is:", c

print "division is: ", d

print "square is:", e

print "square root is", f

return a,b,c,d,e,f

x1 = 0

x = raw_input("enter first number: ")

while not (x.isdigit()):

x = raw_input("enter a valid number: ")

x1 = int(x)

y1 = 0

y = raw_input("enter second number: ")

while not (y.isdigit()):

y = raw_input("enter a valid number: ")

y1 = int(y)

Math(x1,y1)

now i have to make another function named Manipulation(), in which i have to ask user to select any of the two output of function Math()(a,b,c,d,e,f) and then perform all the arithmetic operation again .

Problem is how to compare input entered by user in Manipulation() with output of Math().

Waiting for your reply.

Warm regards