dotfiles/scripts/pycalc_startup.py
2019-11-27 09:32:23 +02:00

14 lines
262 B
Python

from math import *
from fractions import Fraction
def factors(n):
result = set()
for i in range(1, int(sqrt(n)) + 1):
if n % i == 0:
result.add(i)
result.add(n // i)
return result
print("loaded Python calculator")