In python3 we use the lambda operator, you can use it and is like declaring a function in only one line! But, here’s the question. Why we use the lambda operator? Is simple, there are many functions in python3 that we can use with this operator, to work with lists!
We declare the function like this:
lambda x,y: x if x<y else y
this, will declare a function that takes those 2 parameters (x and y), and returns x if x is minor than y, and if it’s not, return y.
Soon, we are going to use this operator for more interesting programs. If it’s not clear yet, you can use this page where i learned it!
Or check this video: