Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #66051
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joel.goldstick@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'subject:Function': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'def': 0.12; 'courses:': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; '"': 0.31; 'url:python': 0.33; 'received:google.com': 0.35; 'choosing': 0.36; 'url:listinfo': 0.36; "didn't": 0.36; 'url:org': 0.36; '12,': 0.39; 'changed': 0.39; 'url:mail': 0.40; 'for:': 0.64; 'to:addr:gmail.com': 0.65 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WqRIYTVGau4qfTN5G16NL5Pa7v+vZYn3T6JxN6pHrwg=; b=cx3GyD2fnxnbfrLUouR5H+DEuzM91KlFPQRTb7b6o6rin5A7OB+yogM3uTGA6NCx25 kfU713eSvuay1xHLwmHISB561RShADGbINZH2NpqCthXieoKQP9CmX36aJL/aosIFqGN FULuI+BF2FlrulcG65WQ6JXrsHTFeZx5nXOIVjOO2g14I/mrPTaJRmbXcNGshKjdFQhr PCAKCWySuV0lQa5cexCbCfSpGdK7PZ0i1d/Pdclr+nuP4czVUGdw69yaBjdZQFMijRan dTZ+GlpYpPmcOM1YLnT6TNwRT4VBchBnl9xSqTC5B4BY8ahqu8oO9RI1WqTNptP9QaDC Dv/w== |
| MIME-Version | 1.0 |
| X-Received | by 10.58.133.15 with SMTP id oy15mr32483834veb.19.1392222086398; Wed, 12 Feb 2014 08:21:26 -0800 (PST) |
| In-Reply-To | <11e9f551-f920-428c-895d-a5d19a4d7734@googlegroups.com> |
| References | <bd88bd17-76d0-43de-9649-daa9ef86155e@googlegroups.com> <mailman.6760.1392219671.18130.python-list@python.org> <11e9f551-f920-428c-895d-a5d19a4d7734@googlegroups.com> |
| Date | Wed, 12 Feb 2014 11:21:26 -0500 |
| Subject | Re: Combination Function Help |
| From | Joel Goldstick <joel.goldstick@gmail.com> |
| To | kjakupak@gmail.com |
| Content-Type | multipart/alternative; boundary=047d7b6d9f82ea417e04f237f675 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6762.1392222089.18130.python-list@python.org> (permalink) |
| Lines | 58 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1392222089 news.xs4all.nl 2862 [2001:888:2000:d::a6]:42223 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:66051 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Y
On Feb 12, 2014 11:00 AM, <kjakupak@gmail.com> wrote:
>
> def choices(n, k):
> if k == 1:
> return n
> if n == k:
> return 1
> if k == 0:
> return 1
> return choices(n - 1, k) + choices(n - 1, k - 1)
Following line never runs
> print ("Total number of ways of choosing %d out of %d courses: " %
(n, k))
>
> n = int(input("Number of courses you like: "))
> k = int(input("Number of courses you can register for: "))
> choices(n, k)
>
> Changed it like you said, didn't work
> --
> https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Combination Function Help kjakupak@gmail.com - 2014-02-12 07:20 -0800
Re: Combination Function Help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 15:40 +0000
Re: Combination Function Help kjakupak@gmail.com - 2014-02-12 07:56 -0800
Re: Combination Function Help Joel Goldstick <joel.goldstick@gmail.com> - 2014-02-12 11:21 -0500
Re: Combination Function Help John Ladasky <john_ladasky@sbcglobal.net> - 2014-02-12 08:24 -0800
Re: Combination Function Help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 16:55 +0000
Re: Combination Function Help Dave Angel <davea@davea.name> - 2014-02-12 13:38 -0500
Re: Combination Function Help kjakupak@gmail.com - 2014-02-12 14:59 -0800
Re: Combination Function Help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 23:15 +0000
Re: Combination Function Help Dave Angel <davea@davea.name> - 2014-02-12 18:22 -0500
csiph-web