Refer to first returned value of function in python

  function, python

I want to refer to the first returned element of a function.

I have a function that returnes two values: alpha and beta.

In the next function, I want to refer to the first value. How is that done? An example of my attempt here:

def helper1(x,y):
    return x*2,y*2

def helper2(a,x,y):
    helper1(x,y)
    a = 2/helper1[0] #here I try to refer to the first element returned of helper1, but doesn't work :( 

any ideas? 😀

Source: Python Questions

LEAVE A COMMENT