I need to satisfy this test:
def test_capitalize_names():
assert ["James"] == capitalize_names(["JAMES"])
assert ["Harry", "Jack"] == capitalize_names(["HArry", "jack"])
I tried writing capitalize_names
like so:
def capitalize_names(input):
input = map(lambda s: s.capitalize(), input)
li = map(lambda x: '"'+x+'"', input)
return li
It is returning ['"James"']
but I want it to return ["James"]
to satisfy the assert statements and I cannot use any control statements.