[Tutor] combine string and integer
Sean 'Shaleh' Perry
shalehperry@attbi.com
Wed, 22 May 2002 14:30:34 -0700 (PDT)
>
> Sean 'Shaleh' Perry [shalehperry@attbi.com]
> if value < 0:
> char = '-'
> else:
> char = ''
>
> return "%d%s" % (abs(value), char)
>
"However, the main problem is to get the - to go behind the amount." is from
the original mail.
When I read that my mind saw "create a string from a template or pattern" and
applied the approach I usually use for that idea.
Patterns appear in coding, you learn to recognize them (-: