Consider this simple python:
def cube(x): return x*x*x; if __name__ == '__main__': print(cube(4));
Works fine. But when I open the python command line interpreter and do:
>>> def cube(x): return x*x*x; ... cube(4);
I get:
File "<stdin>", line 2 cube(4); ^ SyntaxEror: invalid syntax
What nonsense am I doing wrong?
source share