I am not getting why the colon shifted left in the second time
>>> print '%5s' %':'
:
>>> print '%5s' %':' '%2s' %':'
: :
Help me out of this please
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Python, juxtaposed strings are concatenated:
So in your second example, it is equivalent to:
which by the precedence rules for Python’s % operator, is:
or