def str_capitalize(s, lower_rest=False):
return s[:1].upper() + (s[1:].lower() if lower_rest else s[1:])
str_capitalize('fooBar') # 'FooBar'
str_capitalize('fooBar', True) # 'Foobar'
def str_capitalize(s, lower_rest=False):
return s[:1].upper() + (s[1:].lower() if lower_rest else s[1:])
str_capitalize('fooBar') # 'FooBar'
str_capitalize('fooBar', True) # 'Foobar'