I have written some python code but this is not giving me any output please help me to solve.
def main():
num1 = int(raw_input("Enter first number"))
num2 = int(raw_input("Enter second number"))
result = num1 + num2
print result
You haven't called the function that you have created.
This will work:
def main():
num1 = int(raw_input("Enter first number"))
num2 = int(raw_input("Enter second number"))
result = num1 + num2
print result
main()
If this doesn't work then you are probably using python3, in that case try this:
def main():
num1 = input("Enter first number")
num2 = input("Enter second number")
result = num1 + num2
print (result)
main()
main()at the end. And see e.g. sopython.com/wiki/What_tutorial_should_I_read%3F