I need to know python
I don't know why this code for factorial function does not work correctly
here the code:
deff fact(x): while x>0: fac=x*(x-1) x=x-2 if x==1: break return fac
the output for fact(4) is 20 it means the while loop does not work why???!!
and I read that with python I can write codes better and easier in c and c++ and boost them,
and embed codes...this makes me to learn python.!!! is it true!!!???
Edited by macosxnerd101: Please,
This post has been edited by macosxnerd101: 17 August 2010 - 05:51 PM

New Topic/Question
Reply




MultiQuote









|