This is my code:
class robot:
def __init__(givenName,givenColor):
self.name=givenName//error
self.color=givenColor//error
def intro(self):
print("my name izz "+self.name)
r1=robot();
r1.name='tom'
r1.color='red'
r2=robot();
r2.name='blue'
r2.color='blue'
r1.intro()
r2.intro()
I am getting an error in the above commented lines. I know this question has many answers on stackoverflow but none seems to work . the function calls self.color and self.color give the error.