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


Groups > comp.lang.python > #84536

Re: Python simple Code

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'else:': 0.03; 'output': 0.05; 'subject:Python': 0.06; 'sys': 0.07; 'main()': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; 'wrote': 0.14; '2.7': 0.14; 'editor,': 0.16; 'guys,': 0.16; 'main():': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:simple': 0.16; 'wrote:': 0.18; 'result.': 0.19; '>>>': 0.22; 'import': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; 'subject:Code': 0.24; 'question': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'array': 0.29; 'code': 0.31; 'run': 0.32; 'but': 0.35; 'idle': 0.36; 'joined': 0.36; 'list': 0.37; 'expected': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'hope': 0.61; 'sincerely': 0.63; 'choose': 0.64; 'provide': 0.64; 'received:fios.verizon.net': 0.84; 'received:108': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Python simple Code
Date Sat, 24 Jan 2015 20:15:56 -0500
References <4e283f62-0b6a-4ef7-a784-b9b3da73f510@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-108-16-203-145.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
In-Reply-To <4e283f62-0b6a-4ef7-a784-b9b3da73f510@googlegroups.com>
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.18119.1422148807.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422148807 news.xs4all.nl 2959 [2001:888:2000:d::a6]:39295
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84536

Show key headers only | View raw


On 1/24/2015 7:16 PM, Salem Alqahtani wrote:
> Hi Guys,
>
> I just joined the group and I hope that I can help and be active.
>
> I have a question about python. I wrote a code on python 2.7 and I want to choose from the list of names that I provide n!. I execute the code but the result or output is the numbers. I want the people names are the result.
>
>
> Sincerely
>
> import sys
> import array
> a=['salem','Ali','sultan']
> m = len(a)
> def Factorials(m):
>      if m == 0:
>          return 1
>      else:
>          print m
>          return m * Factorials(m-1)
> def output():
>      print a
> def main():
>      print Factorials(m)
>      output()
> main()

When I copy, paste, and run this in Idle editor, I get the expected
 >>>
3
2
1
6
['salem', 'Ali', 'sultan']

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python simple Code Salem Alqahtani <salem055@gmail.com> - 2015-01-24 16:16 -0800
  Re: Python simple Code Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-25 00:38 +0000
    Re: Python simple Code Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-26 19:26 -0800
  Re: Python simple Code Terry Reedy <tjreedy@udel.edu> - 2015-01-24 20:15 -0500
  Re: Python simple Code sohcahtoa82@gmail.com - 2015-01-26 10:13 -0800
  Re: Python simple Code Salem Alqahtani <salem055@gmail.com> - 2015-01-27 15:22 -0800
    Re: Python simple Code Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-27 16:50 -0700
      Re: Python simple Code Salem Alqahtani <salem055@gmail.com> - 2015-01-27 17:35 -0800
    Re: Python simple Code Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-28 03:15 +0000

csiph-web