"Becky Mcquilling" <[email protected]> wrote
Basically, I need to format a string as an example:
"He is {what}.format("{wild}")
I want to insert wild in place of what and output the resulting text
WITH
the curly braces.
what = 'wild'
"Here is {what}".format(what=what)
'Here is wild'
"Here is {what}".format(what='wild')
'Here is wild'
"Here is {{what}}".format(what='wild')
'Here is {what}'
"Here is {what}".format(what='{wild}')
'Here is {wild}'
Take your pick :-)
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor