Post

Consider this #Python code: x = 100 for i in range(10): x = i ** 2 print(x) What is printed? Answer: 81. Wait, isn't x local, inside of the loop? Shouldn't it be 100? Nope — indentation ≠ scope. Inside of a loop, without a function, you're still in the global scope. Questions?

1 repost17 likes