Accessing result

Report a typo

Below you can see a class that represents the location of some object. Look at the function coordinates. How can we get the result?

class Location:

    def __init__(self, x, y):
        self.x = x
        self.y = y

    @property
    def coordinates(self):
        return [self.x, self.y]

loc = Location(1, 2)
Select one option from the list
___

Create a free account to access the full topic