[Tutor] String Replacement Question

Kinuthia Muchane muchanek at gmail.com
Wed May 21 16:59:05 CEST 2008


Moishy Gluck wrote:
>  >>> "%s " %st*3
> 'String String String '
>                             ^
> If you look closely at the end of the string there is an extra space.

> 
>  >>> " ".join((st, )*3)
> 'String String String'
>                            ^
> No extra space.
Ah...Okay!
> 
> On Wed, May 21, 2008 at 9:42 AM, Kinuthia Muchane <muchanek at gmail.com 
> <mailto:muchanek at gmail.com>> wrote:
> 
>                 st = "String"
>                 print "%s " %st*3
> 
>     String String String
> 
> 
> 
>     Does this help?
> 
>     Kinuthia...


More information about the Tutor mailing list