#P0022. 字符串首字母大写
字符串首字母大写
1. Description
Code a function capitalize_first_letters, which takes a string as input and capitalize first letter of all the words in input. And,
- When there're multiple consecutive spaces in input, only output one.
- Ignore beginning and trailing spaces in input
2. Input & Output
Input:
- A string
- Use
input()as input. Notice that the value you get frominput()is a string
Output:
- Use
print()for your output
Example
# Input:
this is the last PC I bought.
# Output:
This Is The Last PC I Bought.
# Input:
one man must have a mind of winter !
# Output:
One Man Must Have A Mind Of Winter !