[Python demo] [4] [Experiment] factorial

Factorial

 

# encoding=utf-8
i = int(input("please input number:  \n"))
k = 1
for j in range(1,i):
    k=k*j
    print("&&&",k)

    
print("###",k)

 

Output:

 

 

 

 

-------- (I am dividing line) --------

reference:

None

 

Remarks:

Initial modified: September 22, 2019 18:15:51

Environment: Windows 7 / Python 3.7.2

 

Guess you like

Origin www.cnblogs.com/kaixin2018/p/11568554.html