Python f string decimal places | python F string format 2 decimal places

preview_player
Показать описание
In this video Python f string decimal places (Python F string decimal places/Python f-string decimal places) you will learn how to print the floating point number with required digits after decimal point, using f - string in Python.
n = 1/3
This will print ---0.3333333333333333 There will be 16 digits after decimal point by default.
To print the number with 2 digits after decimal point, write
{n : . 2f} i.e
{variable : [dot] [number of digits after decimal point] [type] }
{n : . 2f} output will be 0.33
{n : . 3f} output will be 0.333
{n : . 4f} output will be 0.3333
Рекомендации по теме
Комментарии
Автор

I just have to say, thank you so much for making these insanely informational and conceptually simple videos. They make it so easy to grasp the information and I have never seen such a clear cut and detailed explanation jam-packed into an easily watchable video. This video has come in clutch for my upcoming test, and I have to say I owe the majority of it to your videos for giving me that first step to being able to learn programming that I never could have otherwise.

dilipk
Автор

This is the most authentic explaination. First time I have seen such type of video. Keep it up

rahulrokade
welcome to shbcf.ru