I have a Python code as follows, I wrote a function as the same name as the Program name and gave an entry point for the function as follows:
import math
def Problem1():
total=0
for i in range(1000):
if i%3 == 0 or i%5==0 or i%6==0 or i%9==0:
total=total+i
return total
Now I went to terminal ran IPython, and then executed the following statements:
import Problem1
Problem1.Problem1()
It printed the output, even though I dont have a print statement, I have given a return statement, so what is happening here?
Another question : How do I run this directly from the command line, ie how to give something equivalent to void main() of C in Python?