I am getting this error when I try to run function 'iswalking()'
I am trying to learn the OOPs concept and this is so far what I've created ...
class Human:
def __init__(self,name,age,gender):
self.name = name
self.age=age
self.gender= gender
def iswalking(self,TOF):
self.TOF = TOF
if TOF:
print("walking")
else:
print("sitting")
def introduce_self(self):
print("my name is ",self.name)
print("my age is ",self.age)
print("my gender is ",self.gender)
h1=Human("Armaan",16,"male")
h1.iswalking=False
h1.introduce_self()
h1.iswalking()
I expect the output:
my name is Armaan
my age is 16
my gender is male
sitting
what I get:
my name is Armaan
my age is 16
my gender is male
Traceback (most recent call last):
File "main.py", line 19, in <module>
h1.iswalking()
TypeError: 'bool' object is not callable
...Program finished with exit code 1
Press ENTER to exit console.