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
[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
>
[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
[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
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