[Tutor] working with strings in python3

Rance Hall ranceh at gmail.com
Tue Apr 19 02:17:42 CEST 2011


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


More information about the Tutor mailing list