[EMAIL PROTECTED] wrote:

> Im working with python2.2 on red hat linux.
> The following program is supposed to print decreasing numbers from an
> entered number till 1, each decrement being = 1 :
> 
> #! 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
 
> Though it works fine on the python interpretor, i dont get the
> required output when i write this code in gedit (text editor). The
> output that i get is (where t4.py is the name of the file):
> 
> [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!

Don't do such experiments as root. It's too easy to totally mess up your
machine.

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to