Error when creating class

flaviostz flaviostz at gmail.com
Sun Oct 26 11:47:11 EDT 2008


Hi,

I wrote this small program:

class Simples:


    def minha_func (valor1, valor2):
        return valor1 - valor2


mf = Simples()

x = mf.minha_func(2, 3)

print x


But when I try execute it, python interpreter gives me this error:

>>> Traceback (most recent call last):
  File "/tmp/py91849hI", line 11, in <module>
    x = mf.minha_func(2, 3)
TypeError: minha_func() takes exactly 2 arguments (3 given)


Please, help me with this issue.

Thanks,

Flávio



More information about the Python-list mailing list