Python Question/Quiz; What is the output of the following Python code, and why? 🤔🚀Comment your answers below! 👇 #python #programming #developer #morioh #programmer #webdev #webdeveloper #webdevelopment #pythonprogramming #pythonquiz #ai #ml #machinelearning #datascience
@Python_Dv Lambda is an anynomous function which take a list [3,1,4,2] as argument Amd returns that list in sorted order The output will be [1,2,3,4] So, B is the right answer This lamda function simply written as def new(x): returns x.sort() number=[3,1,4,2] print(new(number)
@Python_Dv Answer is B. Lambda function returns sorted list
@Python_Dv Sort function sorts the numbers in ascending order. The answer is B)[1234].
@Python_Dv [1, 2, 3, 4]. lambda function is defined for sorting and return to sort_list. lambda function takes 1 argument x which goes through the iterable.
@Python_Dv D because it's lambda but in the code it is specified as Lambda.
@Python_Dv Is Lambda user defined based on lambda? then answer is B.[1,2,3,4] else D. The code will result in error. HTH
@Python_Dv The code will result to an error because sort_list is not a function so call execute it