Skip to content
Advertisement

Print text from right side

May I know how to print text to the right side like:

                                                                                 This text is at the extreme right

I only know center code is this:

print("This text is center".rjust(165//2))

Thanks Edit

str.rjust(165//2) is center text from:

How to place input function in center of page?

Advertisement

Answer

You are doing well just try to use an int like this

print("Centered right".rjust(40, ""))

The first value is the amount of space de second is the filling item.

Hope it helps

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement