Assign value returned from function to a variable : Return « Function « Python






Assign value returned from function to a variable

 

def square(x) :
    return x * x

print square(10)

x = 10
x = square(x)
print x

   
  








Related examples in the same category

1.Returning Multiple Values from Functions
2.Demonstrates parameters and return valuesDemonstrates parameters and return values