Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python global variable unboundlocalerror

#You must annouce a variable as global
function_uses = 0

def function():
  #To do that type this:
  global function_uses
  #global <var>
  print('This is a function')
  function_uses += 1
 
PREVIOUS NEXT
Tagged: #python #global #variable #unboundlocalerror
ADD COMMENT
Topic
Name
9+3 =