Domanda

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
È stato utile?

Soluzione

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top