Jun-23-2019, 08:07 PM
You indeed have 2 different versions of the code here, and the key is the print statement. The print statement is referencing variables declared inside the function. Those variables vanish upon exit from the function. The issue is the variable scope - that's the topic to read up on.