Re: [Tutor] String formatting expression "g" conversion type case.

2013-01-24 Thread Barnaby Scott
On 24/01/2013 13:29, Krupkina Lesya Olegovna wrote: Hello! I’m newcomer to Python and I’m on documentation reading stage and trying some of examples. I’m using Win7 x64 OS and Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]. I try to understand how string format expres

Re: [Tutor] String formatting expression "g" conversion type case.

2013-01-24 Thread Peter Otten
Krupkina Lesya Olegovna wrote: > Python outputs decimal as declared as but with more significant digits > than default value of 6 - if integer part of the decimal is equal to zero. "%#g"%0.3 > '0.30' In this context "significant digits" are the first non-zero digit and any digits (inclu

[Tutor] String formatting expression "g" conversion type case.

2013-01-24 Thread Krupkina Lesya Olegovna
Hello! I’m newcomer to Python and I’m on documentation reading stage and trying some of examples. I’m using Win7 x64 OS and Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]. I try to understand how string format expression (%)works. Everything is almost clear but except