On Thursday 07 July 2011 15:36:06 Michael M Mason wrote:
> Maybe you've been editing ex25 and then executing ex26. That'd get you the
> same error in the same place over and over again.
Doh! They do say that there is one born every minute.
Thanks,
Lisi
__
"Robert H" wrote
name="world"
print("Hello", name,"!")
Hello world !
However, I don't want the space before the exclamation
mark. I want this:
Hello world!
Can anyone out there help me? Thank you.
I see you've already had two answers, a third is
to construct the string before printing it.
Robert H wrote:
> I have Python 3.2 installed on Windows 7. I am a complete beginner playing
> around with the basic functions. My problem is the following script:
>
>
> name="world"
> print("Hello", name,"!")
>
>
> The result is:
> Hello world !
>
>
> However, I don't want the space before
Sending args to the print command always puts spaces between them.
Try:
print("Hello {name}!".format(name=name))
2011/7/10 Robert H
> Dear all,
>
>
> I have Python 3.2 installed on Windows 7. I am a complete beginner playing
> around with the basic functions. My problem is the following sc
Dear all,
I have Python 3.2 installed on Windows 7. I am a complete beginner playing
around with the basic functions. My problem is the following script:
name="world"
print("Hello", name,"!")
The result is:
Hello world !
However, I don't want the space before the exclamation mark. I want