质数处理和寻找质数的模块
Project description
pyUnit-Prime
质数处理和寻找质数的模块
安装
pip install pyunit-prime
判断是否是质数
from pyunit_prime import is_prime
if __name__ == '__main__':
for i in range(10_0000):
if is_prime(i):
print(i)
寻找一个超大质数
from pyunit_prime import get_large_prime
if __name__ == '__main__':
print(get_large_prime(150)) # 返回长度位150位的质数
返回区间内的质数
from pyunit_prime import prime_range
if __name__ == '__main__':
print(prime_range(100, 10000)) # 返回100到10000区间的质数
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyunit_prime-2020.3.21.tar.gz
(36.7 kB
view hashes)