# 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_b32 жыл бұрын
there are some smileys in this comment
@MohamedAli-vf3vy Жыл бұрын
nice
@adityaragesАй бұрын
:= not mentioned in the video
@gayan91212 жыл бұрын
Hands down, the best tutorial channel ever!
@ArannaAnkonКүн бұрын
srsly???? You dont need to tell that bud. That's an obvious fact
@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.7 ай бұрын
Do know python
@beepbeepgamer13052 жыл бұрын
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 Жыл бұрын
most helpful video ive seen in a while, got my gcse in coding (britsh SAT type thing) and this was nuts helpful
@hayaosman270111 ай бұрын
how did it go I have mines this summer
@UntoldOnYt6 ай бұрын
@@hayaosman2701how did it go?
@hayaosman27016 ай бұрын
@@UntoldOnYt it was decent but I’m glad it’s over🎉
@ZereayM3 ай бұрын
These videos have been so useful, I love you from the bottom of my heart bro very educational, thank you.
@eyalsilbershtein57652 жыл бұрын
Brooo that's crazy! I didn't know about this at all! Thanks
@icantthinkofaname55582 жыл бұрын
Hello bro! You are a legend thank you for your free tutorials! School is not capable of teaching me programming :(
@gdhammr81139 ай бұрын
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 Жыл бұрын
best teacher, thanks for the video!
@hadialhassan50787 ай бұрын
these are amazing to complete one's knowledge about python!
@jokeguy59462 жыл бұрын
Bro how many programming languages do you know?
@sl9060 Жыл бұрын
All of them
@WildBear_2013 Жыл бұрын
@@sl9060most of them
@ҟіӏӏ2 ай бұрын
@@sl9060 definitely not all
@AlexanderCortes210486 Жыл бұрын
Bro you are awesome 👏..!
@adonisbennett920210 ай бұрын
Thank you. no one made it so simple.
@igorbucenko60249 ай бұрын
Bro, thanks. I was confused very much about this topic
@jark76882 жыл бұрын
love these bro quick python knowledge
@popsicle18098 ай бұрын
These are beautiful. Thanks, bro code!
@kashmirtechtv29489 күн бұрын
amazing
@zooeymoments8516 Жыл бұрын
Very helpful..Thanks.
@edwiges_owl6825 Жыл бұрын
Great video, as always.
@thefoolwise2622 жыл бұрын
Bro just uploaded this within an hour of me wanting to know how {} works. That’s the second time this has happened now.
@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 Жыл бұрын
This man is a legend
@fdhdfhsdgsdg30312 жыл бұрын
Bro how do you know almost all programming languages. Appreciate it
@Heheb422 жыл бұрын
Bro, can you make a Lua Tutorial series?
2 ай бұрын
Hi, how can I use the "
@jreamscape8 ай бұрын
thanks bro
@ahmetunaldi76012 ай бұрын
Bro is great
@keisondemoura4603 Жыл бұрын
Thanks from Brasil.
@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?
@aadimgyawali146211 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
Probably coz there's a five (rounding)
@scottrubin84 Жыл бұрын
@@reema8603And don't numbers that end in 5 round up?
@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
@agnichatian11 ай бұрын
because it always rounds up and the given number is nagative: 'up' means towards the positive in the rounding mode that it uses.
@Lunatic3162 жыл бұрын
yo bro i love this tutos can you make some turtle tutorials please i realy do apreciate jt
@prtz24987 ай бұрын
Is it possible to combine 2 format specifiers while printing? For example if i want to print a rounded value with a comma separator?
@ugyenofficial2 жыл бұрын
thank you brother!!!
@knj53202 жыл бұрын
Hey bro Make a video about argument vectors and argument counts in c programming
@BroCodez2 жыл бұрын
I don't think many people would watch it :(
@bekturasanbekov1979 Жыл бұрын
thx 4 vid bro!
@Frfr680 Жыл бұрын
Is there a specific order you need to follow when you are trying to use multiple format specifiers?
@alternativealan5312 жыл бұрын
Ap comp teachers going to a code contest only to see their opponent is bro code
@zr07242 жыл бұрын
bro please make format specifier in java too.
@BroCodez2 жыл бұрын
I already have, printf
@zr07242 жыл бұрын
@@BroCodez thanks :)
@GGFORME-rn3mg5 ай бұрын
Do I have to add the f which is for floating stuff?
@Zer0ne-e2 жыл бұрын
print("*kisses your neck*");
@BroCodez2 жыл бұрын
weird, but ok
@jokeguy59462 жыл бұрын
Chill homie
@Yumiesthetic Жыл бұрын
hahaha
@commonsensetutorials83433 ай бұрын
@StrawdexGuy extremely late but a semicolon doesn't produce an error in python
@BigstickNick7 ай бұрын
I’m not getting anything from the left, right, center on the command line?
@NothingHere-qk1im Жыл бұрын
What does it do? # := = place sign to leftmost position
@pawesedrowski67434 ай бұрын
Is it possible to change the thousands separator?
@meshoDev2 жыл бұрын
First 🎉
@asdasdasd-jj6xt2 жыл бұрын
Print(f"{number:.2f}") works but print(number:.2f) gives an error. Why is that?
@nodabpotato Жыл бұрын
because format specifiers can only be used in f strings
@ganzaian430 Жыл бұрын
What IDE are you using ?
@rabianawaz90942 жыл бұрын
Hello! I need help.how I can get timescalecalculus module/liberary in my python.please help please please please 😭
@hunin27 Жыл бұрын
import timescalcecalculus maybe? idk if python has it
@Malistefek123452 жыл бұрын
Yeeeeeey, in first 100
@arshiaa1042 жыл бұрын
s*x is cool but have you ever tried python with Bro Code?
@valeragames45892 жыл бұрын
1
@NormieDead9 ай бұрын
thx chad who is nerd
@shakil1766 Жыл бұрын
14
@fyrukmcoo1002 жыл бұрын
:((
@BroCodez2 жыл бұрын
:)))
@areeniiitd2 жыл бұрын
@@BroCodez :)))
@anontough69072 жыл бұрын
Damn I love python.
@infiniteisSUS69 Жыл бұрын
This comment section is so far the weirdest I have ever seen