Testing, testing


If you wanted to have the final output capitalize the first letter of the pyglatin word, how would you use .upper() to do that?
As in, have new_word use .upper() just on the first letter [0] to produce a cleaner result to be printed.
My brains are kind of mush today and I can't seem to get it to work on my own, what's the proper syntax etc?


pretty straight forward:

first = word[0].upper()

you can simply make first uppercase


neat, thanks!
i got it to work using new_word = new_word[0].upper() + new_word[1:len(new_word)] but that's obviously messy and convoluted.


it doesn't actually work? because first is moved to the middle.


oh you're right. is there a less convoluted way to get this result besides the one i posted above?
total python newbie :confused:


not really, personally i would use a built-in method like .title():

print new_word.title()


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.