Thanks, as always. It all works.
Becky
On Tue, Feb 1, 2011 at 7:08 AM, Alan Gauld wrote:
> "Becky Mcquilling" 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
>>
"Becky Mcquilling" 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}".forma
Complete test copy & paste:
karim@Requiem4Dream:~$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "He is {what}".format(what="{wild}")
'He is {wild}'
>>>
I don't get the missing "."
You're missing a "." that if your computer is the same as mine, looks like
something left behind by a mosquito
On 1 February 2011 18:33, Karim wrote:
>
> Hello,
>
> >>> "He is {what}".format(what="{wild}")
> 'He is {wild}'
>
> Regards
> Karim
>
>
> On 02/01/2011 09:44 AM, Becky Mcquilling wrote:
Hello,
>>> "He is {what}".format(what="{wild}")
'He is {wild}'
Regards
Karim
On 02/01/2011 09:44 AM, Becky Mcquilling wrote:
Quick question to the group to solve an immediate problem and then if
anyone has a dead simple reference on formatting strings it would be
greatly appreciated as I'm f
Quick question to the group to solve an immediate problem and then if anyone
has a dead simple reference on formatting strings it would be greatly
appreciated as I'm finding this to be pretty confusing.
Basically, I need to format a string as an example:
"He is {what}.format("{wild}")
I want to