Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36610 > unrolled thread

please i need explanation

Started bykwakukwatiah@gmail.com
First post2013-01-11 09:35 -0600
Last post2013-01-13 21:08 +0000
Articles 4 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  please i need explanation kwakukwatiah@gmail.com - 2013-01-11 09:35 -0600
    Re: please i need explanation Hans Mulder <hansmu@xs4all.nl> - 2013-01-12 00:56 +0100
    Re: please i need explanation Tony the Tiger <tony@tiger.invalid> - 2013-01-13 15:04 -0600
      Re: please i need explanation Walter Hurry <walterhurry@lavabit.com> - 2013-01-13 21:08 +0000

#36610 — please i need explanation

Fromkwakukwatiah@gmail.com
Date2013-01-11 09:35 -0600
Subjectplease i need explanation
Message-ID<mailman.389.1357897249.2939.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

def factorial(n):
    if n<2:
             return 1
    f = 1
    while n>= 2:
        f *= n
        f -= 1
    return f

[toc] | [next] | [standalone]


#36660

FromHans Mulder <hansmu@xs4all.nl>
Date2013-01-12 00:56 +0100
Message-ID<50f0a692$0$6955$e4fe514c@news2.news.xs4all.nl>
In reply to#36610
On 11/01/13 16:35:10, kwakukwatiah@gmail.com wrote:
> def factorial(n):
>     if n<2:
>              return 1
>     f = 1
>     while n>= 2:
>         f *= n
>         f -= 1

U think this line should have been:

          n -= 1

>     return f


Hope this helps,

-- HansM

[toc] | [prev] | [next] | [standalone]


#36754

FromTony the Tiger <tony@tiger.invalid>
Date2013-01-13 15:04 -0600
Message-ID<a42dnYpye-b_vG7NnZ2dnUVZ8gOdnZ2d@giganews.com>
In reply to#36610
On Fri, 11 Jan 2013 09:35:10 -0600, kwakukwatiah wrote:

> <HTML><HEAD></HEAD>
> <BODY dir=ltr>
> <DIV dir=ltr>
> <DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
> <DIV>def factorial(n):</DIV>

Right, another html junkie, on windoze, no doubt.

 /Grrr
-- 
          ___                  ___
 (\_--_/)  | _ ._    _|_|_  _   |o _  _ ._
 ( 9  9 )  |(_)| |\/  |_| |(/_  ||(_|(/_|
 stripes are forever - as overripe ferrets

[toc] | [prev] | [next] | [standalone]


#36755

FromWalter Hurry <walterhurry@lavabit.com>
Date2013-01-13 21:08 +0000
Message-ID<kcv7p8$q9p$1@news.albasani.net>
In reply to#36754
On Sun, 13 Jan 2013 15:04:34 -0600, Tony the Tiger wrote:

> On Fri, 11 Jan 2013 09:35:10 -0600, kwakukwatiah wrote:
> 
>> <HTML><HEAD></HEAD>
>> <BODY dir=ltr>
>> <DIV dir=ltr>
>> <DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
>> <DIV>def factorial(n):</DIV>
> 
> Right, another html junkie, on windoze, no doubt.

X-Mailer: Microsoft Windows Live Mail 15.4.3508.1109

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web