The code I currently have makes it so that the entire word is capitalised instead of just the first letter which is what I am trying to accomplish.
There is a nice method for str
called .capitalize()
word = "hello"
word.capitalize()
word = "pinklemon1998"
_word = word[0].upper() + word[1:]
Or as mentioned in the comments:
_word = word.title()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.