dotfiles/scripts/pycalc_startup.py

15 lines
260 B
Python
Raw Normal View History

2019-10-29 15:23:23 +00:00
from math import *
def factors(n):
result = set()
for i in range(1, int(sqrt(n)) + 1):
div, mod = divmod(n, i)
if mod == 0:
result.add(div)
result.add(mod)
return result
2019-10-29 15:23:23 +00:00
print("loaded Python calculator")