Creates a table of book details like author name, title, and total pages. Args: author (str): Name of author title (str): title of the book total_pages (int): total pages in the book
(author, title, total_pages)
| 321 | |
| 322 | |
| 323 | def book_details(author, title, total_pages): |
| 324 | """Creates a table of book details like author name, title, and total pages. |
| 325 | |
| 326 | Args: |
| 327 | author (str): Name of author |
| 328 | title (str): title of the book |
| 329 | total_pages (int): total pages in the book |
| 330 | """ |
| 331 | table = Table(title="\nBook Details :- ", show_lines=True) |
| 332 | |
| 333 | table.add_column("Sr. No.", style="magenta", no_wrap=True) |
| 334 | table.add_column("Property", style="cyan") |
| 335 | table.add_column("Value", justify="left", style="green") |
| 336 | |
| 337 | table.add_row("1", "Title", f"{title}") |
| 338 | table.add_row("2", "Author", f"{author}") |
| 339 | table.add_row("3", "Pages", f"{total_pages}") |
| 340 | |
| 341 | console = Console() |
| 342 | console.print(table) |
| 343 | |
| 344 | |
| 345 | # ms_word() |