How to set local variables in a method

TommyS tommy.skeide at rolls-royce.com
Tue Jan 29 08:16:19 EST 2002


A beginners question...
I intend to set the variables a and b in the getvalues method.. Does
anyone know how to do this??

class test:
 	def calculate(self):
 		a,b = 0,0
 		z = # what to put here???
 		self.getvalues(z)
 		print a + b 
 	def getvalues(self,z):
 		z['a'] = 2

Thanks a lot!



More information about the Python-list mailing list