[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] root]# python t4.py
> enter number: 6
> [EMAIL PROTECTED] root]#
>
> i.e it takes the input but doesn't print anything. If anybody can
> help... Thanx!
You're creating a function called "f" in the first line, but the script never
does anything with it, so it never gets executed. You need to actually call
your function after creating it:
-----
#! usr/bin/env/python
def f(n=int(raw_input("enter number: "))):
print 'n=',n
if n>1:
return n*f(n-1)
else:
print 'end'
return 1
f()
-----
That should do the trick.
--
http://mail.python.org/mailman/listinfo/python-list