[Solved] Using lambda function in python


int(x) yields your error, since you can not convert “A” into an integer

Correct would be:

a="ABCD"
b=map(lambda x:x,a)
print(list(b))

As mentioned in the comments, the following gives the same result:

print(list(a))

You should probably check out some more lambda tutorials first: http://www.secnetix.de/olli/Python/lambda_functions.hawk

solved Using lambda function in python