mardi 3 février 2015

Python: Faster to use global variable or pass as arguments to a function?


Hey so i was wondering which is the more efficient way, or better practice to do in this situation.


1,



def function():
global number
number += 2


Or 2,



def function(number):
return number += 2


Thanks.





Aucun commentaire:

Enregistrer un commentaire