chi-simple-add 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chi_simple_add-0.1.0/LICENSE +17 -0
- chi_simple_add-0.1.0/PKG-INFO +23 -0
- chi_simple_add-0.1.0/README.md +9 -0
- chi_simple_add-0.1.0/pyproject.toml +22 -0
- chi_simple_add-0.1.0/setup.cfg +4 -0
- chi_simple_add-0.1.0/src/chi_simple_add.egg-info/PKG-INFO +23 -0
- chi_simple_add-0.1.0/src/chi_simple_add.egg-info/SOURCES.txt +10 -0
- chi_simple_add-0.1.0/src/chi_simple_add.egg-info/dependency_links.txt +1 -0
- chi_simple_add-0.1.0/src/chi_simple_add.egg-info/top_level.txt +1 -0
- chi_simple_add-0.1.0/src/simple_add/__init__.py +6 -0
- chi_simple_add-0.1.0/src/simple_add/core.py +18 -0
- chi_simple_add-0.1.0/src/simple_add/extra.py +32 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: chi-simple-add
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Package cong hai so don gian - bai tap Python
|
|
5
|
+
Author-email: Chi <email_cua_ban@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/chicc1306/chi-simple-add
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# chi-simple-add
|
|
16
|
+
|
|
17
|
+
Package cộng hai số đơn giản (bài tập Python).
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from simple_add import cong, cong_nhieu_so
|
|
21
|
+
cong(2, 3) # 5
|
|
22
|
+
cong_nhieu_so(1, 2, 3) # 6
|
|
23
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "chi-simple-add" # ĐỔI nếu tên đã có người dùng trên PyPI
|
|
7
|
+
version = "0.1.0" # mỗi lần upload lại phải tăng số version
|
|
8
|
+
description = "Package cong hai so don gian - bai tap Python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Chi", email = "email_cua_ban@example.com" }]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://github.com/chicc1306/chi-simple-add"
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: chi-simple-add
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Package cong hai so don gian - bai tap Python
|
|
5
|
+
Author-email: Chi <email_cua_ban@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/chicc1306/chi-simple-add
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# chi-simple-add
|
|
16
|
+
|
|
17
|
+
Package cộng hai số đơn giản (bài tập Python).
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from simple_add import cong, cong_nhieu_so
|
|
21
|
+
cong(2, 3) # 5
|
|
22
|
+
cong_nhieu_so(1, 2, 3) # 6
|
|
23
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/chi_simple_add.egg-info/PKG-INFO
|
|
5
|
+
src/chi_simple_add.egg-info/SOURCES.txt
|
|
6
|
+
src/chi_simple_add.egg-info/dependency_links.txt
|
|
7
|
+
src/chi_simple_add.egg-info/top_level.txt
|
|
8
|
+
src/simple_add/__init__.py
|
|
9
|
+
src/simple_add/core.py
|
|
10
|
+
src/simple_add/extra.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
simple_add
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Module 1: hàm cộng cơ bản."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def cong(a, b):
|
|
5
|
+
"""Cộng hai số a và b.
|
|
6
|
+
|
|
7
|
+
Tham số:
|
|
8
|
+
a (int | float): số thứ nhất.
|
|
9
|
+
b (int | float): số thứ hai.
|
|
10
|
+
|
|
11
|
+
Trả về:
|
|
12
|
+
int | float: tổng a + b.
|
|
13
|
+
|
|
14
|
+
Ví dụ:
|
|
15
|
+
>>> cong(2, 3)
|
|
16
|
+
5
|
|
17
|
+
"""
|
|
18
|
+
return a + b
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Module 2: hàm mở rộng và tiện ích."""
|
|
2
|
+
import inspect
|
|
3
|
+
|
|
4
|
+
from . import core
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def cong_nhieu_so(*cac_so):
|
|
8
|
+
"""Cộng nhiều số liên tiếp bằng cách dùng hàm ``cong``.
|
|
9
|
+
|
|
10
|
+
Ví dụ:
|
|
11
|
+
>>> cong_nhieu_so(1, 2, 3, 4)
|
|
12
|
+
10
|
|
13
|
+
"""
|
|
14
|
+
tong = 0
|
|
15
|
+
for so in cac_so:
|
|
16
|
+
tong = core.cong(tong, so)
|
|
17
|
+
return tong
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def liet_ke_ham():
|
|
21
|
+
"""Liệt kê tên các hàm công khai của package.
|
|
22
|
+
|
|
23
|
+
Trả về:
|
|
24
|
+
list[str]: danh sách tên hàm.
|
|
25
|
+
"""
|
|
26
|
+
import simple_add
|
|
27
|
+
|
|
28
|
+
return [
|
|
29
|
+
ten
|
|
30
|
+
for ten in simple_add.__all__
|
|
31
|
+
if inspect.isfunction(getattr(simple_add, ten))
|
|
32
|
+
]
|