logo

Crowdly

Browser

Add to Chrome

Mis prinditakse konsooli kui järgnev koodijupp tööle panna? class Apple: ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Mis prinditakse konsooli kui järgnev koodijupp tööle panna?

class Apple: 

def __init__(self, variety):

self.variety = variety

def __repr__(self):

return f"Apple(variety='{self.variety}')"

class Orange:

def __init__(self, variety):

self.variety = variety

def __eq__(self, other):

return isinstance(other, Apple) and self.variety == other.variety

if __name__ == '__main__':

apple = Apple("Gala")

orange = Orange("Navel")

print(apple)

print(orange == apple)

0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.taltech.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome