I would like to get the python code for this problem asap. I am unable to solve the problem in python. Hope someone can help me out. Thank you.