Format specifiers in Python are awesome 💬

  Рет қаралды 61,667

Bro Code

Bro Code

Күн бұрын

#Python #course #tutorial
format specifiers = {:flags} format a value based on what flags are inserted
00:00:00 intro
00:01:35 decimal precision
00:02:41 padding
00:03:15 justify
00:04:18 comma separator
00:04:37 mix and match format specifiers
00:05:03 conclusion

Пікірлер: 71
@BroCodez
@BroCodez Жыл бұрын
# 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 Жыл бұрын
there are some smileys in this comment
@MohamedAli-vf3vy
@MohamedAli-vf3vy Жыл бұрын
nice
@gayan9121
@gayan9121 Жыл бұрын
Hands down, the best tutorial channel ever!
@angeliquewu8318
@angeliquewu8318 8 ай бұрын
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. 9 күн бұрын
Do know python
@beepbeepgamer1305
@beepbeepgamer1305 Жыл бұрын
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.
@eyalsilbershtein5765
@eyalsilbershtein5765 Жыл бұрын
Brooo that's crazy! I didn't know about this at all! Thanks
@adonisbennett9202
@adonisbennett9202 3 ай бұрын
Thank you. no one made it so simple.
@kszoknyik
@kszoknyik 11 ай бұрын
best teacher, thanks for the video!
@jark7688
@jark7688 Жыл бұрын
love these bro quick python knowledge
@icantthinkofaname5558
@icantthinkofaname5558 Жыл бұрын
Hello bro! You are a legend thank you for your free tutorials! School is not capable of teaching me programming :(
@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 3 ай бұрын
how did it go I have mines this summer
@popsicle1809
@popsicle1809 Ай бұрын
These are beautiful. Thanks, bro code!
@igorbucenko6024
@igorbucenko6024 2 ай бұрын
Bro, thanks. I was confused very much about this topic
@zooeymoments8516
@zooeymoments8516 Жыл бұрын
Very helpful..Thanks.
@gdhammr8113
@gdhammr8113 Ай бұрын
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!
@edwiges_owl6825
@edwiges_owl6825 8 ай бұрын
Great video, as always.
@jokeguy5946
@jokeguy5946 Жыл бұрын
Bro how many programming languages do you know?
@sl9060
@sl9060 10 ай бұрын
All of them
@The_Lahmacun123
@The_Lahmacun123 4 ай бұрын
​@@sl9060most of them
@AlexanderCortes210486
@AlexanderCortes210486 8 ай бұрын
Bro you are awesome 👏..!
@jreamscape
@jreamscape Ай бұрын
thanks bro
@Mr.Legend_9
@Mr.Legend_9 7 ай бұрын
This man is a legend
@ugyenofficial
@ugyenofficial Жыл бұрын
thank you brother!!!
@keisondemoura4603
@keisondemoura4603 4 ай бұрын
Thanks from Brasil.
@thefoolwise262
@thefoolwise262 Жыл бұрын
Bro just uploaded this within an hour of me wanting to know how {} works. That’s the second time this has happened now.
@fdhdfhsdgsdg3031
@fdhdfhsdgsdg3031 Жыл бұрын
Bro how do you know almost all programming languages. Appreciate it
@bekturasanbekov1979
@bekturasanbekov1979 11 ай бұрын
thx 4 vid bro!
@cubecube333
@cubecube333 5 ай бұрын
Is there a specific order you need to follow when you are trying to use multiple format specifiers?
@Lit35
@Lit35 6 ай бұрын
the more i watch and do it becomes harder, i barely understood the previous one. im gonna try not giving up
@Heheb42
@Heheb42 Жыл бұрын
Bro, can you make a Lua Tutorial series?
@Lunatic316
@Lunatic316 Жыл бұрын
yo bro i love this tutos can you make some turtle tutorials please i realy do apreciate jt
@NothingHere-qk1im
@NothingHere-qk1im 4 ай бұрын
What does it do? # := = place sign to leftmost position
@ganzaian430
@ganzaian430 6 ай бұрын
What IDE are you using ?
@volitive857
@volitive857 Жыл бұрын
bro make a lua video pls thanks also nice vid
@blushandrush9584
@blushandrush9584 8 ай бұрын
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 4 ай бұрын
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.
@alternativealan531
@alternativealan531 Жыл бұрын
Ap comp teachers going to a code contest only to see their opponent is bro code
@meshoDev
@meshoDev Жыл бұрын
First 🎉
@knj5320
@knj5320 Жыл бұрын
Hey bro Make a video about argument vectors and argument counts in c programming
@BroCodez
@BroCodez Жыл бұрын
I don't think many people would watch it :(
@scottrubin84
@scottrubin84 11 ай бұрын
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 11 ай бұрын
Probably coz there's a five (rounding)
@scottrubin84
@scottrubin84 11 ай бұрын
​@@reema8603And don't numbers that end in 5 round up?
@qber_272
@qber_272 11 ай бұрын
​@@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 3 ай бұрын
because it always rounds up and the given number is nagative: 'up' means towards the positive in the rounding mode that it uses.
@p1nkd0ck62
@p1nkd0ck62 Жыл бұрын
print("*kisses your neck*");
@BroCodez
@BroCodez Жыл бұрын
weird, but ok
@jokeguy5946
@jokeguy5946 Жыл бұрын
Chill homie
@Yumiesthetic
@Yumiesthetic 8 ай бұрын
hahaha
@codertonza
@codertonza Жыл бұрын
Yeeeeeey, in first 100
@asdasdasd-jj6xt
@asdasdasd-jj6xt Жыл бұрын
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
@rabianawaz9094
@rabianawaz9094 Жыл бұрын
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
@zr0724
@zr0724 Жыл бұрын
bro please make format specifier in java too.
@BroCodez
@BroCodez Жыл бұрын
I already have, printf
@zr0724
@zr0724 Жыл бұрын
@@BroCodez thanks :)
@valeragames4589
@valeragames4589 Жыл бұрын
1
@shakil1766
@shakil1766 Жыл бұрын
14
@NormieDead
@NormieDead Ай бұрын
thx chad who is nerd
@arshiaa104
@arshiaa104 Жыл бұрын
s*x is cool but have you ever tried python with Bro Code?
@infiniteisSUS69
@infiniteisSUS69 9 ай бұрын
This comment section is so far the weirdest I have ever seen
@fyrukmcoo100
@fyrukmcoo100 Жыл бұрын
:((
@BroCodez
@BroCodez Жыл бұрын
:)))
@areeniiitd
@areeniiitd Жыл бұрын
@@BroCodez :)))
@anontough6907
@anontough6907 Жыл бұрын
Damn I love python.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 301 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 221 М.
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 18 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 244 М.
Python string format 💬
12:47
Bro Code
Рет қаралды 28 М.
Python *ARGS & **KWARGS are awesome! 📦
14:54
Bro Code
Рет қаралды 68 М.
Python dictionaries are easy 📙
8:06
Bro Code
Рет қаралды 188 М.
String indexing in Python is easy ✂️
7:28
Bro Code
Рет қаралды 49 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 375 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 48 М.