Re: Iteration for Factorials
- From: Py-Fun <lorna.burns@xxxxxxxxx>
- Date: Mon, 22 Oct 2007 05:37:27 -0700
On 22 Oct, 13:28, "Diez B. Roggisch" <de...@xxxxxxxxxxxxx> wrote:
Py-Fun wrote:
I'm stuck trying to write a function that generates a factorial of a
number using iteration and not recursion. Any simple ideas would be
appreciated.
Show us your attempts, and we might suggest a fix. Because otherwise this
sounds suspiciously like homework.
Diez
Here is my futile attempt. Be careful with this though, I just ran
something similar and it was never ending...
def itforfact(n):
while n<100:
print n
n+1
n = input("Please enter a number below 100")
itforfact(n)
.
- Follow-Ups:
- Re: Iteration for Factorials
- From: Amit Khemka
- Re: Iteration for Factorials
- From: Marco Mariani
- Re: Iteration for Factorials
- References:
- Iteration for Factorials
- From: Py-Fun
- Re: Iteration for Factorials
- From: Diez B. Roggisch
- Iteration for Factorials
- Prev by Date: Re: python with braces pre-processor
- Next by Date: Re: I can't get minimock and nosetests to play nice
- Previous by thread: Re: Iteration for Factorials
- Next by thread: Re: Iteration for Factorials
- Index(es):