Your code worked fine for me. Is it possible your "test" variable wasn't true?

message = "Bah."

message = message + " Humbug!"
print(message)
Bah. Humbug!





On Apr 18, 2011 8:17pm, Rance Hall <[email protected]> wrote:
Ok so I know what I am doing is deprecated (or at least poor form) but

the replacement must be awkward cause I'm not getting it.





so this is in a cli based program designed to print status messages to

the terminal on a linux box.



pseudo code:





message = "Bah."



if test:

message = message + " Humbug!"



print(message)



end pseudo code





I'm sure this is not the way we are supposed to augment strings like this.



maybe there is string.append() method or something I should be using instead?



In my case the optional extra parts are always at the end of the

current value of the string.





Thanks for clearing this up for me.



Rance

_______________________________________________

Tutor maillist - [email protected]

To unsubscribe or change subscription options:

http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to