This function works correctly and is giving me the exact value of final_list when I am printing it. 
But when I decided to print final_list separately to check if the value is getting changed globally, I find out that the value of final_list is being changed locally
What to do so that final_list gets changed globally?