MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / prompt

Function prompt

searches/binary_tree_traversal.py:261–265  ·  view source on GitHub ↗
(s: str = "", width=50, char="*")

Source from the content-addressed store, hash-verified

259
260
261def prompt(s: str = "", width=50, char="*") -> str:
262 if not s:
263 return "\n" + width * char
264 left, extra = divmod(width - len(s) - 2, 2)
265 return f"{left * char} {s} {(left + extra) * char}"
266
267
268if __name__ == "__main__":

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected