dotfiles/scripts/pycalc_startup.py

15 lines
262 B
Python
Raw Normal View History

2019-10-29 15:23:23 +00:00
from math import *
2019-11-26 18:28:26 +00:00
from fractions import Fraction
2019-10-29 15:23:23 +00:00
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
2019-10-29 15:23:23 +00:00
print("loaded Python calculator")