How to format print in python.
I bet 99% python developer don’t know this feature. Lets see how the uniquely we will print a text in different way.
I bet 99% python developer don't know this feature. Lets see how the uniquely we will print a text in different way. Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> text = 'INDIA' >>> print(f'{text}') INDIA >>> print(f'{text:.^25}) File "<stdin>", line 1 print(f'{text:.^25}) ^ SyntaxError: unterminated string literal (detected at line 1) >>> print(f'{text:.^25}') ..........INDIA.......... >>> print(f'{text:#>30}') #########################INDIA >>> print(f'{text:_>30}') _________________________INDIA >>>
Please watch above video to end to end Demo.
Please read the article below if you enjoyed this one as well.
What is Mortgage Loan and how to calculate Mortgage loan.