rjust(): right-justified string in Python
Use the rjust() to right-justify a string. word = 'beach' number_spaces = 32 word_justified = word.rjust(number_spaces) print(word) #'beach' print(word_justified) #' beach' Notice the spaces in the second string. The word ‘beach’ has 5 characters, which gives us 27 spaces to…