回答編集履歴

1

Update

2021/11/09 17:26

投稿

melian
melian

スコア20655

test CHANGED
@@ -25,3 +25,35 @@
25
25
  265252859812191058636308480000000
26
26
 
27
27
  ```
28
+
29
+
30
+
31
+ > for関数やwhile関数を使う方法はありませんか?
32
+
33
+
34
+
35
+ ```python
36
+
37
+ def my_factorial(n):
38
+
39
+ fact_n = 1
40
+
41
+ for i in range(2, n+1):
42
+
43
+ fact_n *= i
44
+
45
+
46
+
47
+ return fact_n
48
+
49
+
50
+
51
+ print(my_factorial(30))
52
+
53
+
54
+
55
+ #
56
+
57
+ 265252859812191058636308480000000
58
+
59
+ ```