str.rjust (width [, fillchar])-> str
width - Desired minimum length of the resulting string.
fillchar - The character to expand the string. The default is a space.
The original line is not truncated, even if it contains more characters than the desired length parameter.
'' .rjust (3, 'w') # www
' 1'.rjust (4, 'w') # www1
' 1'.rjust (0, 'w') # 1
'1'.rjust (4) #' 1'
The antonym of the function that positions the string to the left is str.ljust () .
Use str.center () .
Mark Lutz is the global leader in Python training, author of the oldest and best-selling Python texts, and a pioneer in the Python community since 1992.
Mark Lutz is the author of the found...
The rate at which we produce data is growing steadily, thus creating even larger streams of continuously evolving data. Online news, micro-blogs, search queries are just a few examples of these contin...
The genesis of this book began in 2012. Hadoop was being explored in mainstream organizations, and we believed that information architecture was about to be transformed. For many years, business intel...
Managing and analyzing data have always offered the greatest benefits and the greatest challenges for organizations of all sizes and across all industries. Businesses have long struggled with finding ...