更新
This commit is contained in:
15
Python-100-Days/Day01-15/Day04/for3.py
Normal file
15
Python-100-Days/Day01-15/Day04/for3.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
|
||||
输入非负整数n计算n!
|
||||
|
||||
Version: 0.1
|
||||
Author: 骆昊
|
||||
Date: 2018-03-01
|
||||
|
||||
"""
|
||||
|
||||
n = int(input('n = '))
|
||||
result = 1
|
||||
for x in range(1, n + 1):
|
||||
result *= x
|
||||
print('%d! = %d' % (n, result))
|
||||
Reference in New Issue
Block a user