lambda x: float(x[1:-1]) code example
Example 1: map function using lambda in python
# Map function
nums1 = [2,3,5,6,76,4,3,2]
sq = list(map(lambda a : a*a, nums1))
print(sq)
Example 2: lambda x:x[1]
student_tuples = [
('john', 'A', 15),
('jane', 'B', 12),
('dave', 'B', 10),]
sorted(student_tuples, key=lambda student: student[2]) # sort by age
>>>>[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]