unsupported operand type for + Person and Person in python

technical talkiess
0

 

  1. Aap direct two object ko add nahi kar sakte hai ….


TypeError: unsupported operand type(s) for +: 'Person' and 'Person'



Solution :- jis class ko apne object bana ya hai to usme 

Def __add(self,other):

Return self.variable + other.vaiable


Solution :-
Iske liye apko dunder method ka use kar na padenga 

This is error not come twice


Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)