How to Write the AWS Lambda Function with Python?

We’re going to create Lambda Function with Python today. Let’s do something a little more calculation than a simple Hello World application. Let’s pass a couple of numbers into the function, and have it return the sum, difference, multiply and divide of the two numbers.

1. Create the new Lambda Function called Python-Test in AWS Lambda

Click Create function.

2. Create the new Test Event called TestTwoNumbers

Click Create button

3. Add below code to Lambda function

Click Save and Test button to see the result

4. Execution Result

That’s it. I hope this will help. ?
Photo: https://www.brandeps.com

Leave a Reply

Your email address will not be published. Required fields are marked *