a = 'this is a global variable' def yourFunction(arg): #you need to declare a global variable, otherwise an error global a return a.split(' ')