Тёмный

Python string format 💬 

Bro Code
Подписаться 2 млн
Просмотров 30 тыс.
50% 1

Python string format method tutorial explained
#Python #string #format #method
------------------------------
Up In My Jam (All Of A Sudden) by - Kubbi / kubbi
Creative Commons - Attribution-ShareAlike 3.0 Unported- CC BY-SA 3.0
Free Download / Stream: bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A...
------------------------------

Наука

Опубликовано:

 

17 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 70   
@BroCodez
@BroCodez 3 года назад
# str.format() = optional method that gives users # more control when displaying output animal = "cow" item = "moon" print("The "+animal+" jumped over the "+item) # {} = format field print("The {} jumped over the {}".format("cow","moon")) print("The {0} jumped over the {1}".format(animal,item)) # positional arguments print("The {animal} jumped over the {item}".format(animal="cow",item="moon")) # keyword arguments text = "The {} jumped over the {}" print(text.format("cow","moon")) name = "Bro" print("My name is {}".format(name)) print("My name is {:10}".format(name,name)) # amount of padding print("My name is {:10}".format(name,name)) # > = right align print("My name is {:^10}".format(name,name)) # ^ = center align # str.format() = optional method that gives users # more control when displaying output number = 1000 print("The number pi is {:.3f}".format(number)) print("The number is {:,}".format(number)) print("The number is {:b}".format(number)) print("The number is {:o}".format(number)) print("The number is {:X}".format(number)) print("The number is {:E}".format(number))
@MiguelAngel-oz2jp
@MiguelAngel-oz2jp 3 года назад
How you write ^ ? xd
@thorcoder1
@thorcoder1 3 года назад
@@MiguelAngel-oz2jp to centre the name
@MiguelAngel-oz2jp
@MiguelAngel-oz2jp 3 года назад
@@thorcoder1 I wanted say how write that in my keyboard xd
@farhanishraq7820
@farhanishraq7820 3 года назад
@@MiguelAngel-oz2jp shift + 6
@benjaminjohnpabroquez8012
@benjaminjohnpabroquez8012 Год назад
animal = 'cow' Item = 'moon' print(f'the {animal} jump over the {item}') Thank me later
@samirkarki8880
@samirkarki8880 Год назад
I didn't understood this first when my Proffessor taught me but you made it easy for me. Thanks Bro!!!
@khiemdo5527
@khiemdo5527 2 года назад
Very great content, and well explain for new programmer. Thanks Bro Code
@raven4291
@raven4291 10 месяцев назад
Thanks bro! This made my life so much easier!
@josephthecreator
@josephthecreator 2 года назад
Simply AMAZING!
@PROGame_aisetinski_channel
@PROGame_aisetinski_channel 3 года назад
Thanks a lot!
@piotrkopcewicz5227
@piotrkopcewicz5227 2 года назад
Significant tutorial !! Thx
@user-vf5qp4re8l
@user-vf5qp4re8l 7 месяцев назад
I wish we had a professor like you
@tihomirsmoljak7355
@tihomirsmoljak7355 Год назад
bro i just discover u and this is awesome im on my start with python and this is just what i need simple and easy and useful....great job and hope u r still arround im going to check the rest of ur channel and subscribe thanks
@melihhopa2684
@melihhopa2684 2 года назад
hocam süpersiniz devam lütfen
@udaysaimanoj2117
@udaysaimanoj2117 2 года назад
Good content!!
@imadiman528
@imadiman528 Год назад
You're are great I understand it very smoothly 🌹🌹🌹
@quick_information101
@quick_information101 2 года назад
You are doing well and you have a great explications
@nyiaung4963
@nyiaung4963 3 месяца назад
very helpful for my study
@spartanranger
@spartanranger 2 года назад
Thanks for the video Bro
@thorcoder1
@thorcoder1 3 года назад
Great op sir👍
@kemann3815
@kemann3815 2 года назад
Splendid
@danilabakunin6571
@danilabakunin6571 Год назад
Very cool video
@airlanggak5391
@airlanggak5391 2 года назад
thanks man!
@user-hh6zn8fg1e
@user-hh6zn8fg1e Год назад
First time watching your video, really great content. Thanks for sharing Bro
@davidchilton23
@davidchilton23 3 месяца назад
This video was very helpful. It was very concise and comprehensive (to my knowledge).
@sehunhan1195
@sehunhan1195 Год назад
good to have as a reference when you are reviewing someone else's code that uses .format() however, just use f-strings as it is superior in everyway, readability, easier, and faster
@prannavl3651
@prannavl3651 Год назад
Nice video .
@rasheduzzaman_6
@rasheduzzaman_6 9 месяцев назад
our bro is always best
@tarikyassa1076
@tarikyassa1076 3 года назад
Thanks bro!
@mostafaghobashy2724
@mostafaghobashy2724 Год назад
good
@mohammedamirjaved8418
@mohammedamirjaved8418 2 года назад
Love you Bro...
@NormieDead
@NormieDead 3 месяца назад
thx chad i had forgotin that
@neeraj4210
@neeraj4210 3 года назад
👍👌
@beingzero7541
@beingzero7541 2 года назад
Wow!
@saebsallam2414
@saebsallam2414 2 месяца назад
Your awesome man
@chrisnorthall8317
@chrisnorthall8317 2 месяца назад
*you're
@hyperbeetle2006
@hyperbeetle2006 Год назад
Neat.
@hailsnover6214
@hailsnover6214 3 года назад
what about adding blank spaces to numbers?
@techlace1195
@techlace1195 Год назад
tnx bro
@kraxpan2618
@kraxpan2618 2 года назад
thanks bro
@shavindasilva
@shavindasilva 2 года назад
thanks BROOO!!
@howardsamuels7695
@howardsamuels7695 Год назад
Really, really appreciate these easy to follow instructions. I am hoping that we will get some chance to put all of these together and get to use these pieces. Great. Thanks again.
@danielmalatji1813
@danielmalatji1813 Год назад
Wow that's all I can say💯💯💯
@anitaakabogu3997
@anitaakabogu3997 2 года назад
thx man
@seabiscuitthechallenger6899
@seabiscuitthechallenger6899 5 месяцев назад
👍
@zoireshmatov1840
@zoireshmatov1840 2 года назад
PYTHON VERY GREAT
@jackw9030
@jackw9030 2 года назад
there is an even nicer way to write this code print(f"The {animal} jumped over the {item} ")
@Darkownercute
@Darkownercute 2 года назад
Its true nice
@DMcDonald14
@DMcDonald14 2 года назад
Whoohoooooo
@budderrar5751
@budderrar5751 Год назад
noice
@Yu-Gi-Oh36508
@Yu-Gi-Oh36508 Год назад
i think this video is outdated now, now you can do print(f"the {animal} jumped over the {item}") or maybe it isnt, but either way that way is much easier
@knownrobloxian3381
@knownrobloxian3381 2 года назад
why not do print(f"The {animal} jumped over the {item}")
@janlochman1985
@janlochman1985 9 месяцев назад
What does it mean it's written more elegantly? I don't see the differences.
@mjordan1117
@mjordan1117 Год назад
How are these more elegant than the normal + format? My python teacher said the same but I dont understand why. This method seems more stressful to me.
@haltsmaul.
@haltsmaul. Год назад
Use fStrings instead of either.
@nikoli6612
@nikoli6612 2 года назад
Is Simeone ^468,,. #Stringcode
@roxxbloodfallen6743
@roxxbloodfallen6743 3 года назад
Can't we just use f strin
@hamzaammar4356
@hamzaammar4356 2 года назад
you can but he show u more
@GetNatpavee
@GetNatpavee Год назад
Is this why “{insert thing here}” meme exist?
@dorakake7484
@dorakake7484 2 года назад
Wait isn't this is F String ???
@manavkumar348
@manavkumar348 11 месяцев назад
i = 0 while True: if i == 5: while i > 0: i -= 1 print(" "*i, "I just became a Bro") else: i += 1 print(" "*i, "I just became a Bro")
@manavkumar348
@manavkumar348 11 месяцев назад
Do not run this code
@ankushbhagatofficial
@ankushbhagatofficial 8 месяцев назад
Nice snake
@pbsmoothie7281
@pbsmoothie7281 Год назад
YT algorithm comment
@johnmcclure5051
@johnmcclure5051 2 года назад
This feels illegal being free
@Samoniel2910
@Samoniel2910 2 года назад
why do we even need this?
@haaruncaderrr
@haaruncaderrr Месяц назад
G
@axlecode8598
@axlecode8598 Год назад
👍
Далее
ALL 47 STRING METHODS IN PYTHON EXPLAINED
23:34
Просмотров 121 тыс.
Python string slicing ✂️
11:37
Просмотров 58 тыс.
Miyagi & Andy panda - minor (пародия Beatrise)
0:30
5 More Useful F-String Tricks In Python
9:38
Просмотров 44 тыс.
While loops in Python are easy ♾️
6:58
Просмотров 325 тыс.
25 nooby Python habits you need to ditch
9:12
Просмотров 1,7 млн
5 Useful Dunder Methods In Python
16:10
Просмотров 55 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 387 тыс.
Python sets 🍴
6:59
Просмотров 23 тыс.
Python dictionaries 📖
8:01
Просмотров 25 тыс.
Functions in Python are easy 📞
10:38
Просмотров 419 тыс.
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Просмотров 1,8 млн
Я УКРАЛ ТЕЛЕФОН В МИЛАНЕ
9:18
Просмотров 119 тыс.