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!
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.
Thanks a lot it was really helpful!!
Join our real-time social learning platform and learn together with your friends!