dotfiles/scripts/pycalc_startup.py
2019-11-14 19:40:52 +02:00

14 lines
260 B
Python

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
print("loaded Python calculator")