Difference makes the DIFFERENCE
The following is the code that I have written in Google Colab, with Python V3.0, for the given problem 1 -
thinking, it is good to share and can be helpful for me in future.
The following will be the output to the above code.