string formatting in python 2.7 code example Example: String Formatting with the % Operator >>> name = 'Bob' >>> 'Hello, %s' % name "Hello, Bob"