Issue
print(f'{"jane":^10} {"marry":^10} {"paul":^10} {"jhon":^10}')
print(f'{"*":^10} {"*":^10} {"*":^10} {"*":^10}'
can anyone tell me what happens with the ":^10" in this code .
Solution
The curly braces surround the string parts which are to be formatted, and the parts after the colon specify how they are formatted. The caret specifies that the text will be centered, and the 10 specifies that that part of the formatted string will be 10 characters.
Answered By - SelflessPotato
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.