Python returns the use of multiple values +lambda

Source: Internet
Author: User

defMaxmin (A, b):if(a>b):returnA, bElse:        returnb,a max,min=maxmin (8,95)Print "The maximum value is:", MaxPrint "The minimum value is:", MinPrint "*********lambda***********"g=LambdaX:x*8Print "Lambda creates an anonymous function:", G (5) G1=LambdaX, Y, Z: (x+y) *ZPrintG1 (5,2,10)Print "********** Logarithmic ************" fromMathImportLogPrintLog (64,2)#The first argument is the true number, the second argument is the basePrint "******* use lambda to write a fixed base logarithm ***********"defMake_function (Base):return LambdaX:log (x,base) Mk=make_function (8)Print "The logarithm is 8, and the value of true number 64 is:", MK (64)

Results:

Return multiple values
The maximum value is: 95
The minimum value is: 8
lambda***********
Lambda Create anonymous function: 40
70
Logarithmic ************
6.0
Write a fixed base logarithm with lambda
The logarithm is 8, and the value of true number 64 is: 2.0


Python returns the use of multiple values +lambda

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.