문제

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
도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top