CoreDump: Dr Bheemaiah, on Python 101. Episode I

Monitor-Tabby: Welcome to CoreDump, the one stop for techies or wanna-be techies, if you are just in high school, but thought you should be in grad school, this is the place, stay tuned. In this episode Dr Bheemaiah, tired of itch and pains in the butt, has decided to busy himself with an experiment!

Here it is:

Dr Bheemaiah: For some EdTech with Python 101, we consider writing AWS Lambdas in python, this lets you write handles for intents you define , for example in Alexa or add any trigger to execute the Lambda. An AWS Lambda is simply a collection of functions, which are executed as one thread by a trigger.

We start with a template of a simple Lambda, we can modify.

import os

def lambda_handler(event, context):

what_to_print = os.environ.get(“what_to_print”)

how_many_times = int(os.environ.get(“how_many_times”))

# make sure what_to_print and how_many_times values exist

if what_to_print and how_many_times > 0:

for i in range(0, how_many_times):

# formatted string literals are new in Python 3.6

print(f”what_to_print: {what_to_print}.”)

return what_to_print

return None

You need to enter the environmental values, what_to_print and how_many_times, both are entered in a user friendly GUI, on AWS.

Log into AWS, and select a blank function template without a trigger. Add this code in the function code box and select add the environment variables as key and value pairs,

https://www.fullstackpython.com/blog/aws-lambda-python-3-6.html

Save the function and test, it!

Next we define the outlines for learning Python the fast and easy way, the AWS low code way!.

  1. Given Python code, evaluate the algorithms efficiency in polynomial steps and resource usage in asymptotic.
  2. Learn to store code as a code snippet in a snippet library and share with others.

3. Evaluate the code on sonarqube, and learn to recognize good code from bad code, learn the evaluation criteria and algorithms.

4. Laziness is the mother of invention and minimalism, use existing snippets to complete your code. Never reinvent the wheel. Given snippets complete them, and use them in your problem.

5. Natural Programming Vs Python, transpile from one to another, open problem: Can you automate this?

6. Requirements to User stories, understand how to read requirements, select the best architecture and algorithms and write user stories and UML, convert UML to Python code.

7. Open Problems, some problems are open, you can write a paper on your solutions.

8. Hidden Bugs, if possible I will write buggy code on purpose, if you find the bug, subject to availability, there may be gifts like Alexa T Shirts or A.B trinkets.

FAQ:

What is a thread.

What is object oriented programming.

Is python object oriented.