Python Lesson 07: Formatting Float Output and Rounding Up

preview_player
Показать описание
Formatting the output to take into account the precision requirements for a float value. Two methods are shown in this video.
Рекомендации по теме
Комментарии
Автор

Hi Drew, good explanation, just one query, is there a way I can externalise the no of digits I want to format to. To be precise, can I use a constant to hold '2' and then use it in the format method ?

vishnum