Ask your own question, for FREE!
Computer Science 24 Online
OpenStudy (blackstreet23):

Make the first character uppercase in python 3.4.1 I know that you can make a whole statement capital by using ".upper" but .upper() but how do you just make just the first word capital on input statement? How would i I make it in this case? custumer_name = input(format("Enter Custumer's name: ",">27s")) print (custumer_name) What I would like to do is that, if I input "peter" it "peter" it capitalizes the first letter "P" and then it prints it as "Peter". Thank you a lot guys!

OpenStudy (maitre_kaio):

You could use the built-in capitalize() method: https://docs.python.org/3.4/library/stdtypes.html#str.capitalize Or if you want to do it yourself, extract the first letter, uppercase it and put it back at the first position.

OpenStudy (blackstreet23):

Thanks a lot it was really helpful!!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!