Cats

Report a typo

Your friend has so many cats that they've found themselves in need of a program to keep information about them. Here's the code they've written:

from dataclasses import dataclass, field

@dataclass(order=True)
class MyCat:
    sort_index: int = field(init=False)
    name: str
    weight: int
    age: int
    
    def __post_init__(self):
        self.sort_index = self.weight

Take a look at this piece of code and choose all the correct statements about it.

Select one or more options from the list
___

Create a free account to access the full topic