I learned something new about Strings in Python!

preview_player
Показать описание
Today I learned a new formatting rule for Strings in Python!

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python #shorts
Рекомендации по теме
Комментарии
Автор

I had no idea you can use _ to begin with, all these years

Idiiinc
Автор

I learned lot of things from your every shorts/videos .... Keep going 👍

shitaleshdurge
Автор

I never knew you could do this with strings and i've been with python for a few months now. Thanks!

Mizuki-Mikos-Music-Corner
Автор

That’s actually game changing. If someone wanted to make a gui or something and needed the number more readable this is really the only way lol

cheesierglint
Автор

that's really helpful! didn't know something like this existed

philip
Автор

Я это узнал впервые когда искал с какой версии появились f-строки (в 3.6 кстати), и просто полез почитать о них подробнее, ещё одна полезная вещь которой я часто пользуюсь это выравнивание:
s = 'Hi'
print(f'{s:>10}')
print(f'{s:^10}')
print(f'{s:i<10}')

И я рад что хоть кто-то хоть где-то об этом рассказал на YouTube.

nkit
Автор

I didn't know either of those tips. Thanks!

trondknudsen
Автор

Awesome!!!! Thanks for sharing this tip with us!

SimoneSoleri
Автор

Dude! I didn't know this!!! You helped a lott

denner
Автор

Whoah, so that's how you include comas! Awesome!

ianpropst-campbell
Автор

I never knew you could do that with strings. Thanks for sharing this!

lukekratz
Автор

Cool tip, as usual, you dig into python, and bring us those jewels!

sheikhakbar
Автор

I found that from Bro Code's py tutorial series too!
And you can also format the number to binary too

notpowder
Автор

i learned something new too, thank you!

mdhidayat
Автор

wow very help full thank god in future i wont smash my head thinking why cant my program work,

ravitejatippabhatla
Автор

oh, cute (goes back to writing kernels in c)

ekstrapolatoraproksymujacy
Автор

Hi your shorts are very nice thank you.
One piece of advice- end of video is too fast, before we see the output, video finishes

tempaccnt
Автор

Very good. Thank you very much. SPECIAL

tuphan
Автор

I wish those underscores could disappear when you convert it to string to find an index

patrickman
Автор

How does that adopt to users locale? For instance, here in India we separate digits as 10, 00, 00, 000 as opposed to regularly separating by 3 digits

Abhijeet-idfs