Write A Lambda Function To Print Hello World

Hi Guys, welcome to my blog in this article you will learn about how to Write A Lambda Function To Print Hello World

 

Title : 

Write A Lambda Function To Print Hello World



Write A Lambda Function To Print Hello World


 

Description : 

Hey guys in this article you will learn how to print hello world using lambda function in python. This is a simple Python program to implement where a Lambda function doesn't take any input argument and just execute the single print statement. Take a Lambda function named as fun() and use the Lambda keyword to define the Lambda function and use the print statement inside the Lambda function. In the print Function just print the allow world


    
fun = lambda: print("Hello, World !")


    


In the main program just called the Lambda function to print the all world just call fun()


    
fun()


    




Complete Python Code : 


    
fun = lambda: print("Hello, World !")

fun()


    

 

 

Output : 


    
Hello, World !


    



Conclusion :

The above Python program defines a lambda function that does not take any argument and just prints hello world on the standard output. In the main program the lambda function gets called and the function will get executed and hello world will be printed. Comment it down below if you have any suggestions to improve the above Python program

 


Post a Comment

0 Comments