You can do this with str.ljust(width[, fillchar]) : Return the string left justified in a string of length width. Padding is done using the ... ... <看更多>
We introduced Python's string type and a few of these methods earlier; ... to remove spaces (or other characters) from the beginning or end of the string. ... <看更多>
https://www.programiz.com/c-programming/library-function/ctype.h/isspace. isspace() checks if a character is a white-space or not (blanks, ... ... <看更多>