Question from the Python test

How to simplify this class in Python?

Medium

What are the ways to remake this class in a simplified way (the class must have the features of this one)?

class Foo:
    def __init__(self, attribute1: str, attribute2: str, attribute3: str):
        self.attribute1 = attribute1
        self.attribute2 = attribute2
        self.attribute3 = attribute3
    def __repr__(self):
        return f"Foo(attribute1='{self.attribute1}', attribute2='{self.attribute2} ', attribute3='{self.attribute3}')"
Author: Pierre ChaumontStatus: PublishedQuestion passed 51 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!