The output of following code is
5
3
I am new to Python, could anybody explain to me why?
import sys
def Main():
str='1+2'
print eval(str)
class A:
def __init__(self):
self.x = 5
a = A()
print a.x
if __name__=="__main__":
Main()