Question

I'm an newbie playing around with JES and I'm testing how to call a variable in from another function to the main function. I'm using return which from what I understand should return variable num but it's still erroring :( Any guidance would be most appreciated.

def update():
  a = sqrt(10)
  b = 239
  getTotal(a,b)
  print num

def getTotal(a,b):
  num = a*b
  return num
Was it helpful?

Solution

Need somewhere for that value to return to.

Try this:

def update():
  a = sqrt(10)
  b = 239
  c = getTotal(a,b)
  print c

def getTotal(a,b):
  num = a*b
  return num
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top