Re: Error in following code

2007-06-23 Thread Bjoern Schliessmann
Jay Loden wrote: > That should do the trick. Additionally, it does the trick to save the first entered number as default argument forever. Regards, Björn -- BOFH excuse #117: the printer thinks its a router. -- http://mail.python.org/mailman/listinfo/python-list

[OT] Re: Error in following code

2007-06-21 Thread Peter Otten
[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 >

Re: Error in following code

2007-06-21 Thread Efrat Regev
[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

Re: Error in following code

2007-06-21 Thread Jay Loden
[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 i

Error in following code

2007-06-21 Thread zaperaj
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) els