Converting string cases
def case(name):
if "A" in name:
return name.upper()
elif "e" in name:
return name.lower()
else:
return name.title()
Function Call | Return Value | |||
---|---|---|---|---|
case('Anna') | → | |||
case('MIGUEL') | → | |||
case('FRed') | → | |||
case('Mr. Rodgers') | → | |||
case('oliVia') | → |
Experiment with this code on Gitpod.io