def capitalize(string, *restToLower):
if (restToLower == True):
print(string.capitalize())
else: print(string[0].upper() + string[1:])
OR
def capitalize(string, *restToLower):
if (restToLower == True):
print(string.capitalize())
print(string[0].upper() + string[1:])
The above mentioned function always running else
statement.
I created this function to take a string and convert it into capitalize
format.
What I want
if capitalize('apple')
- "Apple"
and if capitalize('aPPle')
- "APPle"
and if capitalize('aPPle', restToLower = True')
or capitalize('aPPle', True)
- "Apple"