Python - string ljust() method


Python tip:

You can use .ljust() to create a left-justified string of given width.

string.ljust(width, fillchar)

Padding is a space, " ", by default.

print("Mike".ljust(10, "*"))
# => Mike******