Linux Today: Linux News On Internet Time.

Python4Kids: New Tutorial - Format Strings and Silly Sentences

Jun 16, 2011, 05:04 (0 Talkback[s])
(Other stories by brendanscott)

[ Thanks to Brendan Scott for this link. ]

"In this tutorial we’re going to look at formatting strings. In the previous tute we constructed a string by adding (using the ‘+’ operator) them together. Building strings this way can be a little challenging. Another way to do it, is to use formatting strings. We put place markers into a string, and match the place markers with values to go in there. The place markers are identfied by a % sign in the string, and values are added at the end after a % sign. "

Complete Story

Related Stories: