logo

Crowdly

Browser

Add to Chrome

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

✅ 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 Book:

def __init__(self, title, author):

self.title = title

self.author = author

def __repr__(self):

return f"Book(title='{self.title}', author='{self.author}')"

def __str__(self):

return f"'{self.title}' by {self.author}"

if __name__ == '__main__':

book = Book("1984", "George Orwell")

print(book)

print(repr(book))
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