Question: I was given a task which was to find the largest value in a list using a lambda function. With the lambda function, I must have two parameters and I am having a hard time how to retrieve elements from a list to use in a lambda function.

I understand how to perform the task by defining a function but I do not know how to translate that to a lambda function.

```
myList = [1,2,3,4,5,6,7,8,9,10]

#Here I can find the max value by defining a function

def maxVal(list_a):

   max = 0

   for i in list_a:

       if i > max:
          max = i
   return max
print(maxVal(myList))

#Here I attempt to use a lambda function to find the max value

maxMyList = map(lambda x,y: x[0] >= y[0], myList, myList)

print(maxMyList(myList,myList))

```

Edit: Sorry for any confusion as this is my first time posting here. Just for clarity, I CANNOT define any functions for use in this program. I just wanted to post the code for the defined function maxVal to show that I understand the logic of what I need to do. Thank you for all of your responses, I really appreciate it!

Answer: 
You can define a function that takes a list as the first parameter and optionally a current maximum as the second parameter, and recursively calls itself with the first item in the list as the second argument if it's bigger than the current maximum or if the current maximum is `None`, and the rest of the list as the first argument, until the rest of the list is empty, at which point returns the current maximum:

```
maxVal = lambda lst, m=None: maxVal(lst[1:], m if m is not None and lst[0] < m else lst[0]) if lst else m

```

so that:

```
from random import shuffle
myList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle(myList)
print(maxVal(myList))

```

outputs: `10`
Python has a built-in function for sorting lists. It's `sorted()`

Ex: `sorted([2, 8, 8, 3, 7, 4, 2, 93, 1])` = `[1, 2, 2, 3, 4, 7, 8, 8, 93]`

We can use the subscript `[::-1]` to reverse the list, so the completed lambda function is:

```py
maxVal = lambda l: sorted(l)[::-1][0]

```