Format specifiers in Python are awesome 💬

  Рет қаралды 90,291

Bro Code

Bro Code

Күн бұрын

Пікірлер: 86
@BroCodez
@BroCodez 2 жыл бұрын
# format specifiers = {:flags} format a value based on what flags are inserted # .(number)f = round to that many decimal places # :(number) = allocate that many spaces # :0(number) = allocate and zero pad that many spaces # :< = left justify # :> = right justify # :^ = center align # :+ = use a plus sign to indicate positive value # := = place sign to leftmost position # : = insert a space before positive numbers # :, = comma separator # :% = percentage format price1 = 3.14159 price2 = -987.65 price3 = 12.34 print(f"price1 is: ${price1:}") print(f"price2 is: ${price2:}") print(f"price3 is: ${price3:}")
@timo_b3
@timo_b3 2 жыл бұрын
there are some smileys in this comment
@MohamedAli-vf3vy
@MohamedAli-vf3vy Жыл бұрын
nice
@adityarages
@adityarages Ай бұрын
:= not mentioned in the video
@gayan9121
@gayan9121 2 жыл бұрын
Hands down, the best tutorial channel ever!
@ArannaAnkon
@ArannaAnkon Күн бұрын
srsly???? You dont need to tell that bud. That's an obvious fact
@angeliquewu8318
@angeliquewu8318 Жыл бұрын
You literally saved me at 3 am in the morning from something I have been working on for 6+ hours, thank you so much 😭😭😭 I guess I hadn’t fully understood how the justifies worked but your explanation was so clear
@Fortnitecrab.
@Fortnitecrab. 7 ай бұрын
Do know python
@beepbeepgamer1305
@beepbeepgamer1305 2 жыл бұрын
I only knew formatting in string, using curly braces and after the string value, type .format(val1,val2...). Depending on the no. Of curly braces you use inside the string, you need to specify that no of values in the end. You also have to insert the values in which order you have specified inside the string.
@nicomarti5956
@nicomarti5956 Жыл бұрын
most helpful video ive seen in a while, got my gcse in coding (britsh SAT type thing) and this was nuts helpful
@hayaosman2701
@hayaosman2701 11 ай бұрын
how did it go I have mines this summer
@UntoldOnYt
@UntoldOnYt 6 ай бұрын
​@@hayaosman2701how did it go?
@hayaosman2701
@hayaosman2701 6 ай бұрын
@@UntoldOnYt it was decent but I’m glad it’s over🎉
@ZereayM
@ZereayM 3 ай бұрын
These videos have been so useful, I love you from the bottom of my heart bro very educational, thank you.
@eyalsilbershtein5765
@eyalsilbershtein5765 2 жыл бұрын
Brooo that's crazy! I didn't know about this at all! Thanks
@icantthinkofaname5558
@icantthinkofaname5558 2 жыл бұрын
Hello bro! You are a legend thank you for your free tutorials! School is not capable of teaching me programming :(
@gdhammr8113
@gdhammr8113 9 ай бұрын
Thank you so much for this video! My professor showed us a different way to do it, but it was more complicated than this. Thank you!
@kszoknyik
@kszoknyik Жыл бұрын
best teacher, thanks for the video!
@hadialhassan5078
@hadialhassan5078 7 ай бұрын
these are amazing to complete one's knowledge about python!
@jokeguy5946
@jokeguy5946 2 жыл бұрын
Bro how many programming languages do you know?
@sl9060
@sl9060 Жыл бұрын
All of them
@WildBear_2013
@WildBear_2013 Жыл бұрын
​@@sl9060most of them
@ҟіӏӏ
@ҟіӏӏ 2 ай бұрын
​@@sl9060 definitely not all
@AlexanderCortes210486
@AlexanderCortes210486 Жыл бұрын
Bro you are awesome 👏..!
@adonisbennett9202
@adonisbennett9202 10 ай бұрын
Thank you. no one made it so simple.
@igorbucenko6024
@igorbucenko6024 9 ай бұрын
Bro, thanks. I was confused very much about this topic
@jark7688
@jark7688 2 жыл бұрын
love these bro quick python knowledge
@popsicle1809
@popsicle1809 8 ай бұрын
These are beautiful. Thanks, bro code!
@kashmirtechtv2948
@kashmirtechtv2948 9 күн бұрын
amazing
@zooeymoments8516
@zooeymoments8516 Жыл бұрын
Very helpful..Thanks.
@edwiges_owl6825
@edwiges_owl6825 Жыл бұрын
Great video, as always.
@thefoolwise262
@thefoolwise262 2 жыл бұрын
Bro just uploaded this within an hour of me wanting to know how {} works. That’s the second time this has happened now.
@Lit35
@Lit35 Жыл бұрын
the more i watch and do it becomes harder, i barely understood the previous one. im gonna try not giving up
@Mr.Legend_9
@Mr.Legend_9 Жыл бұрын
This man is a legend
@fdhdfhsdgsdg3031
@fdhdfhsdgsdg3031 2 жыл бұрын
Bro how do you know almost all programming languages. Appreciate it
@Heheb42
@Heheb42 2 жыл бұрын
Bro, can you make a Lua Tutorial series?
2 ай бұрын
Hi, how can I use the "
@jreamscape
@jreamscape 8 ай бұрын
thanks bro
@ahmetunaldi7601
@ahmetunaldi7601 2 ай бұрын
Bro is great
@keisondemoura4603
@keisondemoura4603 Жыл бұрын
Thanks from Brasil.
@blushandrush9584
@blushandrush9584 Жыл бұрын
Hello, thanks for this tutorial. It was very helpful. I'm new to python. Where can i find a full overview of all format specififers?
@aadimgyawali1462
@aadimgyawali1462 11 ай бұрын
from python's documentation, you don't need to Rember all of he, use jupyter notebook which can just show you all the possible format specifiers than the regular ides each time you want.
@scottrubin84
@scottrubin84 Жыл бұрын
Why does price 2 get truncated (from -987.65) to -987.6 when the .1f is used but price 1 gets rounded (from 3.14159) to 3.142 when the .3f formatter is used?
@reema8603
@reema8603 Жыл бұрын
Probably coz there's a five (rounding)
@scottrubin84
@scottrubin84 Жыл бұрын
​@@reema8603And don't numbers that end in 5 round up?
@qber_272
@qber_272 Жыл бұрын
​@@scottrubin84i think it doesn't round them up, it just ignored any preceding decimal digits, just like in floor division "x//y", if the result has decimal places, it will not include it and will return the whole number without rounding them up
@agnichatian
@agnichatian 11 ай бұрын
because it always rounds up and the given number is nagative: 'up' means towards the positive in the rounding mode that it uses.
@Lunatic316
@Lunatic316 2 жыл бұрын
yo bro i love this tutos can you make some turtle tutorials please i realy do apreciate jt
@prtz2498
@prtz2498 7 ай бұрын
Is it possible to combine 2 format specifiers while printing? For example if i want to print a rounded value with a comma separator?
@ugyenofficial
@ugyenofficial 2 жыл бұрын
thank you brother!!!
@knj5320
@knj5320 2 жыл бұрын
Hey bro Make a video about argument vectors and argument counts in c programming
@BroCodez
@BroCodez 2 жыл бұрын
I don't think many people would watch it :(
@bekturasanbekov1979
@bekturasanbekov1979 Жыл бұрын
thx 4 vid bro!
@Frfr680
@Frfr680 Жыл бұрын
Is there a specific order you need to follow when you are trying to use multiple format specifiers?
@alternativealan531
@alternativealan531 2 жыл бұрын
Ap comp teachers going to a code contest only to see their opponent is bro code
@zr0724
@zr0724 2 жыл бұрын
bro please make format specifier in java too.
@BroCodez
@BroCodez 2 жыл бұрын
I already have, printf
@zr0724
@zr0724 2 жыл бұрын
@@BroCodez thanks :)
@GGFORME-rn3mg
@GGFORME-rn3mg 5 ай бұрын
Do I have to add the f which is for floating stuff?
@Zer0ne-e
@Zer0ne-e 2 жыл бұрын
print("*kisses your neck*");
@BroCodez
@BroCodez 2 жыл бұрын
weird, but ok
@jokeguy5946
@jokeguy5946 2 жыл бұрын
Chill homie
@Yumiesthetic
@Yumiesthetic Жыл бұрын
hahaha
@commonsensetutorials8343
@commonsensetutorials8343 3 ай бұрын
@StrawdexGuy extremely late but a semicolon doesn't produce an error in python
@BigstickNick
@BigstickNick 7 ай бұрын
I’m not getting anything from the left, right, center on the command line?
@NothingHere-qk1im
@NothingHere-qk1im Жыл бұрын
What does it do? # := = place sign to leftmost position
@pawesedrowski6743
@pawesedrowski6743 4 ай бұрын
Is it possible to change the thousands separator?
@meshoDev
@meshoDev 2 жыл бұрын
First 🎉
@asdasdasd-jj6xt
@asdasdasd-jj6xt 2 жыл бұрын
Print(f"{number:.2f}") works but print(number:.2f) gives an error. Why is that?
@nodabpotato
@nodabpotato Жыл бұрын
because format specifiers can only be used in f strings
@ganzaian430
@ganzaian430 Жыл бұрын
What IDE are you using ?
@rabianawaz9094
@rabianawaz9094 2 жыл бұрын
Hello! I need help.how I can get timescalecalculus module/liberary in my python.please help please please please 😭
@hunin27
@hunin27 Жыл бұрын
import timescalcecalculus maybe? idk if python has it
@Malistefek12345
@Malistefek12345 2 жыл бұрын
Yeeeeeey, in first 100
@arshiaa104
@arshiaa104 2 жыл бұрын
s*x is cool but have you ever tried python with Bro Code?
@valeragames4589
@valeragames4589 2 жыл бұрын
1
@NormieDead
@NormieDead 9 ай бұрын
thx chad who is nerd
@shakil1766
@shakil1766 Жыл бұрын
14
@fyrukmcoo100
@fyrukmcoo100 2 жыл бұрын
:((
@BroCodez
@BroCodez 2 жыл бұрын
:)))
@areeniiitd
@areeniiitd 2 жыл бұрын
@@BroCodez :)))
@anontough6907
@anontough6907 2 жыл бұрын
Damn I love python.
@infiniteisSUS69
@infiniteisSUS69 Жыл бұрын
This comment section is so far the weirdest I have ever seen
@SS369
@SS369 20 күн бұрын
Thanks bro
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 341 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Python dictionaries are easy 📙
8:06
Bro Code
Рет қаралды 282 М.
Let's code a beginner Python BANKING PROGRAM 💰
15:01
Bro Code
Рет қаралды 326 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 448 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,3 МЛН
5 More Useful F-String Tricks In Python
9:38
Indently
Рет қаралды 54 М.
How I Would Learn Python FAST (if I could start over)
12:19
Thu Vu data analytics
Рет қаралды 698 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 347 М.
Python F Strings Explained in 15 Minutes
17:00
Ryan & Matt Data Science
Рет қаралды 1,1 М.
Python - полный курс для начинающих. Этот навык изменит твою жизнь.
5:27:42
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 169 М.