[Tutor] Using Python to solve factoria

Hedgar ajakzhedgar at gmail.com
Wed Dec 21 02:50:02 EST 2016


I really happy to be accepted to the list!
This is my current function:

def factoria(numb):
While numb > 1:
If numb==0:
return 1
result = numb*(numb-1)
numb = numb -1
return result
#should output 120
What am I not getting right?

Sent from my iPhone

> On 21 Dec 2016, at 01:17, tutor-request at python.org wrote:
> Welcome to the Tutor at python.org mailing list! This list is for folks
> who want to ask (and/or answer) questions from folks who wish to learn
> how to program with Python.  Feel free to ask even the most basic of
> questions -- that's what the list is for!
> For best results when asking a question on this list: - Try to write
> some code to solve your problem - Show the code you have written -
> Describe what the code does and what you want it to do - If the code
> generates an error, copy and paste the entire error message, including
> the traceback, into your email. - Tell us what OS and Python version
> you are using.
> - Don't ask us to do your homework. - Don't assume we know what you
> are talking about. If you are having trouble with a third-party
> library, include a link to the library home page.
> When replying to a posting: - Use Reply All to reply to the entire
> list - Don't top post - put your reply after the text to which you are
> replying
> For all posts: - Format your email as plain text, not HTML
> To post to this list, send your message to:
>  tutor at python.org
> General information about the mailing list is at:
>  https://mail.python.org/mailman/listinfo/tutor
> If you ever want to unsubscribe or change your options (eg, switch to
> or from digest mode, change your password, etc.), visit your
> subscription page at:
>  https://mail.python.org/mailman/options/tutor/ajakzhedgar%2Bnewsletter%40gmail.com
> You can also make such adjustments via email by sending a message to:
>  Tutor-request at python.org
> with the word `help' in the subject or body (don't include the
> quotes), and you will get back a message with instructions.
> You must know your password to change your options (including changing
> the password, itself) or to unsubscribe without confirmation.  It is:
>  analyst
> Normally, Mailman will remind you of your python.org mailing list
> passwords once every month, although you can disable this if you
> prefer.  This reminder will also include instructions on how to
> unsubscribe or change your account options.  There is also a button on
> your options page that will email your current password to you.

More information about the Tutor mailing list