Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def make_banner(txt: str, padding: int = 5, border: str = '*') -> str:
return (
f'{border * (len(txt) + padding * 2)}\n'
f'{" " * padding}{txt}\n'
f'{border * (len(txt) + padding * 2)}'
)
banner = make_banner('Banner as a variable', 4, '#')
print(banner)
print(make_banner('Print me now! :)', 4, '#'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment