16 lines
334 B
Python
16 lines
334 B
Python
class Student:
|
|
def __init__(self,name,s_id):
|
|
self.name = name
|
|
self.s_id = s_id
|
|
def __eq__(self,other):
|
|
if self.name == other.name and self.s_id == other.s_id:
|
|
return True
|
|
return False
|
|
|
|
s1=Student("A",1)
|
|
s2=Student("A",1)
|
|
if s1 == s2:
|
|
print("equal")
|
|
else:
|
|
print("not equal")
|