A Python package for providing mental arithmetic calculation skills
Project description
Kousuan Skill
一个提供口算计算技巧的Python包,帮助提高心算能力和数学计算技巧。
功能特性
- 基础四则运算
- 快速加法技巧
- 快速乘法技巧
- 数字分解
- 百分比计算
- 乘法表生成
- 心算技巧集合
安装
pip install kousuan
使用方法
命令行工具
# 加法
kousuan calc "15+17"
Python API
from kousuan.core import resolve
results = resolve('13*17')
心算技巧
本包包含多种心算技巧,包括:
- 乘以11的技巧:两位数乘以11时,将两个数字相加,结果放在中间
- 乘以5的技巧:乘以10再除以2
- 乘以9的技巧:乘以10再减去原数
- 以5结尾的数字平方:将前一位数字乘以(前一位数字+1),后面加上25
- 百分比计算:计算10%时,将小数点左移一位
开发
安装开发依赖
pip install -e .[dev]
运行测试
pytest
代码格式化
black kousuan/
flake8 kousuan/
许可证
MIT License
作者
liandong
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kousuan-0.1.2.tar.gz
(181.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
kousuan-0.1.2-py3-none-any.whl
(292.3 kB
view details)
File details
Details for the file kousuan-0.1.2.tar.gz.
File metadata
- Download URL: kousuan-0.1.2.tar.gz
- Upload date:
- Size: 181.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4118158f06736a568f9074fda6aa970067304aec933f14ec74f53778aff6bba5
|
|
| MD5 |
08d0a17cfa957d464fe351ddeb426a2f
|
|
| BLAKE2b-256 |
6e1081d892a2fb6e82ea37c58310971f3c1a6502818b0580eba7dcc09fa719ee
|
File details
Details for the file kousuan-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kousuan-0.1.2-py3-none-any.whl
- Upload date:
- Size: 292.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990cb4dc5d177f874d349031c5501790f7ce706e3de2dc1b0695220b8179f111
|
|
| MD5 |
5439a87ed4293d0f0076d051ed8bceab
|
|
| BLAKE2b-256 |
4daba45c6dcc956d98e5423e0c7e627a161b0f03a3f88771645c6676f908ed16
|