Why python shell stores last expression in _ variable but python file does not?
Why python shell stores last expression in _ variable but python file does not? Question: I ran below code in python shell and from a python file, I expected the same output but ironically i get NameError: name ‘_’ is not defined error in python file. >>> 10+2 12 >>> print(_) 12 So i started …