I am new to Python, and I have problem solving the code I have, getting confused to make it work.
I have a working code with help of StackoverFlow (thanks), this code