How can I only get either the first or the second return only by running a def function. I am trying to only get the value for the addition for WhatIsA and I am only trying to get the multiplication value for WhatIsB. I know that the code below is not convenient but I just want to know if there is a way to specify the only index of the return values as you run the program like a[0] or b[1]. How would I be able to do that?
def WhatIsA(value1, value2):
a[0] = Values(value1,value2)
return a[0]
def WhatIsB(value1, value2):
b[1] = Values(value1,value2)
return b[1]
def Values(value1,value2):
a = value1+value2
b = value1*value2
return a, b
print(WhatIsA(10, 15))
print(WhatIsB(2, 12))
Output:
(25, 150)
(14, 24)
Expected Output:
25
24