Sail E0 Webinar
Question
What is the output of the following?print('*', "abcdef".center(7), '*')
Options:
A .  * abcdef *
B .  * abcdef *
C .  *abcdef *
D .  * abcdef*
Answer: Option B


Padding is done towards the left-hand-side first when the final string is of odd length. Extra spaces are present since we haven't overridden the value of sep.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers