I want to create a class that includes two functions where one of them calls the other one, for example:
class Parser:
def foo(a):
return a
def bar(b):
return foo(b * 2)
This errors out with:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 6, in bar
NameError: name 'foo' is not defined
self.foo1(a)
or you mixed the vars and you want to returnfoo2(a)
. You should read about Classesfoo2()
.