*PROGRAM TO FIND FACTORIAL OF A NUMBER(I HAVE WRITTEN IT ON GEDIT)*
x=1
n=input('enter a positive integer no:')
for i in range(1,1+n):
x=x*i
print x
*ERROR:*
enter a positive integer
no:---------------------------------------------------------------------------
EOFError Traceback (most recent call last)
C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
execfile(fname, glob, loc)
166 else:
167 filename = fname
--> 168 exec compile(scripttext, filename, 'exec') in glob, loc
169 else:
170 def execfile(fname, *where):
C:\Users\as\mnb.py in <module>()
1 x=1
----> 2 n=input('enter a positive integer no:')
3 for i in range(1,1+n):
4 x=x*i
5 print x
EOFError: EOF when reading a line
*QUESTION*:
HOW TO ASK INPUT FROM USER THEN?
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor