Files
30-seconds-of-code/test/capitalize/capitalize.py
Rohit Tanwar 385bf72a3e readme-script
2018-02-20 22:42:11 +05:30

2 lines
124 B
Python

def capitalize(string, lower_rest=False):
return string[:1].upper() + (string[1:].lower() if lower_rest else string[1:])