stringValue = "String formatting" print "Fifteen and five characters allowed in string:" print "(%.15s) (%.5s)" % ( stringValue, stringValue )