Skip to content

Commit 0576a5d

Browse files
authored
Added factors method (#19)
1 parent 6c681eb commit 0576a5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

easyPythonpi/easyPythonpi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ def factorial(n): # To find the factorial of 2 numbers
2424
# single line to find factorial
2525
return 1 if (n == 1 or n == 0) else n * factorial(n - 1)
2626

27+
# To compute the factord of the argument passed
28+
def factors(n):
29+
factors = []
30+
for i in range(1, n+1):
31+
if n % i == 0:
32+
factors.append(i)
33+
return factors
34+
2735
def Area_circle(r): # To find the area of a circle using the radius r
2836
PI = 3.142
2937
return PI * (r * r)

0 commit comments

Comments
 (0)