ropering / Study

0 stars 0 forks source link

[Python] capitalize #1

Open ropering opened 2 years ago

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

capitalize("CouGar") # CouGar
capitalize("CouGar") # Cougar