⬅︎ Back to How to pad/fill a string by a variable in Python using f-strings
You can pad with a character by doing the following (the padding character must come before the direction and length): f"{mystr:*<10}" # Yields 'peter****'
Comment
You can pad with a character by doing the following (the padding character must come before the direction and length): f"{mystr:*<10}" # Yields 'peter****'