Question: Python 2.7.3

```
>>> print '%2.2f' % 0.1
0.10

```

The documentation I have says that type % should be the same as type f except that the input is multiplied by 100.

```
>>> print '%2.2%' % 0.1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not all arguments converted during string formatting

```

Answer: 
use the new format expression, which has the formatter you are referring to

```
print "{:%}".format(0.1)
#10.000000%

```

if you just want the integer part you can use the precision specification

```
print "{:.0%}".format(0.1)
#10%

```

see the doc at 

<http://docs.python.org/2/library/string#formatspec>

To expand a little bit, the new format specificator is really more powerful than the old one. First of all it's really simple calling the parameters by order or name

```
"play the {instrument} all {moment}, even if my {instrument} is old".format(moment='day', instrument='guitar')
#'play the guitar all day, even if my guitar is old'

```

then, as can be seen in the documentation, is possible to have access to properties of the object:

```
"the real component is {0.real} and the imaginary one is {0.imag}".format(3+4j)
#'the real component is 3.0 and the imaginary one is 4.0'

```

There is a lot more than this, but you can find it all in the documentation, that is very clear.
```
print '%2.2%' % 0.1

```

Tells it that there are 2 placeholders in format string (%), so you have a complain