DEV Community

Alex Tread
Alex Tread

Posted on • Originally published at pybuddy.com

99% of Python Programmers don't know this feature

Did you use or know about this feature before?

text = "PYTHON"

print(f"{text}")
# PYTHON
print(f"{text:#<20}")
# PYTHON##############
print(f"{text:_>20}")
# ______________PYTHON
print(f"{text:.^20}")
# .......PYTHON.......
Enter fullscreen mode Exit fullscreen mode

Top comments (8)

Collapse
 
robertbyers1111 profile image
robertbyers1111

Now 98.976% don't know

Collapse
 
lokesh2703 profile image
Lokesh Koliparthi

I too didn't know about this. Thanks for sharing

Collapse
 
sehgalspandan profile image
Spandan Sehgal

Amazing feature...
I didn't knew it too.
Thanks for telling.

Collapse
 
moustymainer profile image
MoustY MaineR👨🏾‍💻

Nice one bruh

Collapse
 
emeabad_007 profile image
Miguel Abad

Nice

Collapse
 
acode123 profile image
acode123

THanks!

Collapse
 
albertocarom profile image
alberto Caro Matinez

WoW thanks for sharing.

Collapse
 
tvergutz profile image
Thomas Vergutz

Wow! That is really good to add to the readability during testing phase!! Thanks for sharing!