Post

@PythonPr x will be 10 for python3.x why because of variable scope inside list comprehension are confined to that only and doesn't exposed outside.
English

@PythonPr Could you explain the x for x in range three-part I don't understand a loop like that.
English

@PythonPr I believe it will be 2.
It's a generator expression that overwrites the value of x, like the loop block.
So, the interpretation modify this value, because it's not a local scope, like the functions.
But, if it does, so the value will be 10, because everything happened in local.
English



















