I have the following:
class User:
"""A user class"""
def __init__(self, username, father)
"""Initialize the user class"""
self.username = name
self.father = father
def main():
user1 = User("foo", "oldman")
user2 = User("bar", "oldman1")
Assume I have more people to fill in their data, and they will have all kind of different inputs about their father's name. How can I make a function to check if two or more objects have the same father attribute in python?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…