Skip to content

Commit f9a5478

Browse files
authored
Enhance prompt function with width parameter
Updated prompt function to accept width parameter and modified example outputs accordingly.
1 parent 79d72d7 commit f9a5478

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

searches/binary_tree_traversal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,11 @@ def prompt(s: str = "", width=50, char="*") -> str:
264264
>>> [prompt("Python", width=width) for width in range(8, 13)]
265265
[' Python ', ' Python *', '* Python *', '* Python **', '** Python **']
266266
267-
>>> prompt("Python", char=chr(0x1F40D))
268-
'🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍 Python 🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍'
267+
>>> prompt("Python", width=40, char=chr(0x1F40D))
268+
'🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍 Python 🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍'
269+
270+
>>> len(prompt("Python"))
271+
50
269272
270273
>>> prompt("Python", -200)
271274
' Python '

0 commit comments

Comments
 (0)