kinuthia muchane wrote:
> Hi,
>
> 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.
>
>
> def factorial(n):
>       if n <= 1:
>         return 1
>       else:
>         return n * factorial(n-1)
>
> factorial(some number here)
>
>   
print factorial(some number here)

When you enter an expression at the interactive prompt you see the 
value. Not true when you run a program. Expression values must be 
printed. So you are doing nothing wrong.

-- 
Bob Gailer
919-636-4239 Chapel Hill, NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to