saving . . . saved format specifiers has been deleted. format specifiers has been hidden .
format specifiers
Title
Question
Why do we use %3.2f and %2.1f? Can we use any other value apart from these? I do understand that the value after the decimal represents the number of places to be displayed after the decimal point. But what is the use of 3 and 2??

Python-3.4.3 Input-output 03-04 min 0-10 sec 11-08-20, 12:39 a.m. Mitalidas

Answers:

In %3.2f a number will be formatted in such a way that the number contains 3 digits (in total) and 2 decimal places after the decimal point.
11-08-20, 10:56 a.m. ankitrj.iitb
Ohh yeah! I got it. Thank you. That was very helpful.

12-08-20, 6:28 p.m. Mitalidas

Login to add comment


Log-in to answer to this question.