On 1/1/11 6:06 PM, rudi wrote:
Hello,
I have been trying to capitalize all the letters but I don“t know how
to make the correct loop code.
For instance, I have looped all the letters of the word and append
them in an array.So if my name is rudi
I get myCapitalArray=[R,U,D,I].
Now,how do i go and get myCapitalName  = RUDI.

PS:obviously it is
myCapitalName=myCapitalArray[0]+myCapitalArray[1]+myCapitalArray[2]+myCapitalArray[3]
but I am having each time a diferent name with diferent number of
letters, so how can I do a smart loop for that?

Cheers


yourName = "rudi"
yourName.upper()

That's all you need, but for future reference
myCapitalArray=[R,U,D,I].
''.join(myCapitalArray)

The '' are two single quotes, which creates an empty string, which joins the elements of the array.


Dado

--
http://groups.google.com/group/python_inside_maya

Reply via email to