Why Python code run faster in a function
stackoverflow.com