''' formattedstrings.py Jeff Ondich, 2013-01-05 Demonstrates formatted strings (surprise!). Intended as the Python half of parallel examples in Python and Java. See FormattedStrings.java. ''' n = 701 x = 3.0 / 7.0 animal = 'gerenuk' announcement1 = 'The animal: %s' % (animal) announcement2 = 'The integer: %d (decimal), %X (hexadecimal)' % (n, n) announcement3 = 'The real number with 2, then 3 digits past the decimal point: %.2f, %.3f' % (x, x) print announcement1 print announcement2 print announcement3