Clean Name Case

This kind of formatting is often used for names and simple headings when you want one consistent style. Given a word word, make its first letter uppercase and all remaining letters lowercase. Return the formatted word.

Примеры

Ввод
"Aakash"
Вывод
"Aakash"
Ввод
"aakash"
Вывод
"Aakash"
Ввод
"AAKASH"
Вывод
"Aakash"

Нужно реализовать

def to_title_case(word: str) -> str:

Теги

strings
PostgreSQLv16

Aici va apărea rezultatul execuției codului

Visible tests
1
Input
"Aakash"
Expected"Aakash"
2
Input
"aakash"
Expected"Aakash"
3
Input
"AAKASH"
Expected"Aakash"
4
Input
"aAkAsH"
Expected"Aakash"
5
Input
"hsakaA"
Expected"Hsakaa"
6
Input
"AakashAakash"
Expected"Aakashaakash"
Focus radio
Paused · SomaFM · Fluid