17 lines
560 B
Python
17 lines
560 B
Python
class Book:
|
|
|
|
def __init__(self, name: str, description: str, image: str, review: str) -> None:
|
|
self.name: str = name
|
|
self.description: str = description
|
|
self.image: str = image
|
|
self.review: str = review
|
|
|
|
def to_html(self) -> str:
|
|
return f"""
|
|
<tr>
|
|
<td class="name">{self.name}</td>
|
|
<td class="description">{self.description}</td>
|
|
<td class="image">img/{self.image}</td>
|
|
<td class="review">{self.review}</td>
|
|
</tr>
|
|
""" |