"kinuthia muchane" <[EMAIL PROTECTED]> wrote > I do not know what I am doing wrong. When I run the following code > from > the Python prompt it executes without a murmur. But when I save it > as > a .py file and try to execute it from the shell, it just returns the > prompt...actually it is all scripts that return a value which are > behaving in this manner.
The >>> prompt evaluates expressions and prionts the value. The interpreter on the other hand does not automatically print values you ghave to explicitly tell it to print using the print statement. So in your case just add the print command in front of the function call and all will be well. > factorial(some number here) print factorial(n) HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor