Hello, I'm new to python and I'm writing a very small script which takes each letter of a string and adds text to it (I know this is not a good explanation but you'll understand below :) )
anyway, this is my current code:
def textColor(string, color1, color2):
color = color1
for a in string:
print "<" +color+ "><b>" +a+ "</b></" +color+ ">",
if color == color1:
color = color2
else:
color = color1
so when I run let's say textColor("testing","black","red")
it returns:
<black><b>t</b></black> <red><b>e</b></red> <black><b>s</b></black> <red><b>t</b></red> <black><b>i</b></black> <red><b>n</b></red> <black><b>g</b></black>
now this works just fine exept that space in between each block of text, I can't get it to stick together, now I know this is a very easy question but I need some quick help
thanks
--
Too often we lose sight of life's simple pleasures. Remember when someone annoys you it takes 42 muscles in your face to frown, BUT, it only takes 4 muscles to extend your arm and bitch-slap that mot...@#?!&! upside the head!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020712/73245205/attachment.htm>