程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Factoring n in Python

編輯:Python

This question requires the preparation of procedures , Calculation N The factorial .

Input format : Input gives a positive integer on a line N.

Output format : In a row, press “product = F” Output the value of factorial in the format of F, Please note that there is a space to the left and right of the equal sign . The calculation results should not exceed the double precision range .

sample input :

5

sample output :

product = 120
x = int(input()) a = 1 for i in range(1, x+1): a = a*i print("product = %d" % float(a)) 

That's all for this sharing , If it helps you , Give me a compliment before you go ~


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved