fork download
  1. factor_list = [ ]
  2.  
  3. def integer_test(x):
  4.  
  5. if type(x) == int:
  6. return True
  7. else:
  8. return False
  9.  
  10. def factor_checker(x):
  11.  
  12. count = 0
  13. y = x
  14. while count <= y:
  15. print(count)
  16. count += 1
  17. if integer_test(x / count) == True:
  18. factor_list.append(count)
  19.  
  20. factor_checker(45)
  21.  
  22. print(factor_list)
Success #stdin #stdout 0.01s 7852KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46]