163578/how-can-i-capitalize-the-first-letter-of-each-word-in-a-string
value = 'the fat cat'
...do something here...
value should be:
'The Fat Cat'
How to do this in Python?
By using the .title() method of string we can get the first letter of every word capitalized
value = 'the fat cat' value.title()
Output
The .title() method of a string (either ASCII or ...READ MORE
I'd like to locate the first index ...READ MORE
class Solution: def firstAlphabet(self, s): self.s=s k='' k=k+s[0] for i in range(len(s)): if ...READ MORE
There are several options. Here is a ...READ MORE
suppose you have a string with a ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
items = [] items.append("apple") items.append("orange") items.append("banana") len(items) #use the ...READ MORE
The reason is that they are using ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.