质数处理和寻找质数的模块
Project description
pyUnit-Prime 
质数处理和寻找质数的模块
安装
pip install pyunit-prime
命令行运行:打开控制台
prime -h # 获取帮助
命令行:
判断是否是质数: prime -P 13
寻找一个超大质数: prime -L 100
返回区间内的质数: prime -R 100,500
判断是否是质数
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.22.tar.gz
(38.6 kB
view details)
File details
Details for the file pyunit_prime-2020.3.22.tar.gz.
File metadata
- Download URL: pyunit_prime-2020.3.22.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a7138954b6cb46913eebdcf753da8d67bdfdb72089023509ccf0bbb74e8b538
|
|
| MD5 |
c50a6f01c2a4744e0348c66251cc7d49
|
|
| BLAKE2b-256 |
7abbd4644a71a69544d68d0a89da327fd05b6d9b1dff5593afaa4c4d59d623d2
|