Prints out the index in proper format with title name and page number Args: toc (nested list): toc[1] - Topic name toc[2] - Page number
(toc)
| 258 | |
| 259 | |
| 260 | def print_index(toc): |
| 261 | """Prints out the index in proper format with title name and page number |
| 262 | |
| 263 | Args: |
| 264 | toc (nested list): toc[1] - Topic name |
| 265 | toc[2] - Page number |
| 266 | """ |
| 267 | dash = "-" * (100 - 7) |
| 268 | space = " " * 47 |
| 269 | print(f"{space}INDEX") |
| 270 | print(f"\n\nName : {dash} PageNo.\n\n\n") |
| 271 | for topic in toc: |
| 272 | eq_dash = "-" * (100 - len(topic[1])) |
| 273 | print(f"{topic[1]} {eq_dash} {topic[2]}") |
| 274 | |
| 275 | |
| 276 | def print_n_speak_index(toc): |