Library operasi himpunan untuk tugas pemrograman Python
Project description
Himpunan
Sebuah library Python untuk operasi himpunan (Set Operations) yang diimplementasikan menggunakan magic methods Python.
✨ Fitur
- Membuat, menambah, dan mengurangi anggota himpunan
- Irisan
/ - Gabungan
+ - Selisih
- - Selisih Simetris
* - Komplemen (
komplement()) - Himpunan Kuasa (
abs()) - Produk Kartesius (
**) - Subset, Superset, dan Ekuivalen (
<=,>=,//)
📦 Instalasi
pip install afl2-himpunan==0.1.1
Contoh
from afl2_himpunan import Himpunan
S = Himpunan(1,2,3,4,5,6,7,8,9) h1 = Himpunan(1, 2, 3) h2 = Himpunan(3, 4, 5)
print(len(h1)) # Output: 3 print(3 in h1) # Output: True print(h1 == h2) # Output: False
h1 += 4 # Menambah elemen 4 ke h1 print(h1) # Output: Himpunan([1, 2, 3, 4])
h3 = h1 / h2 # Irisan print(h3) # Output: Himpunan([3, 4])
h4 = h1 + h2 # Gabungan print(h4) # Output: Himpunan([1, 2, 3, 4, 5])
h5 = h1 - h2 # Selisih print(h5) # Output: Himpunan([1, 2])
h6 = h1.Komplemen(S) # Komplemen print(h6) # Output: Himpunan([5, 6, 7, 8, 9])
print(abs(h1)) # Output: 16
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
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
File details
Details for the file afl2_himpunan-0.1.1.tar.gz.
File metadata
- Download URL: afl2_himpunan-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15a29acae0e4e972b40bcbb4100b16d1d331f4369acfe56bae665fc8d6ca2808
|
|
| MD5 |
f6b2472783988f67e9026bb1bd01c72a
|
|
| BLAKE2b-256 |
baf9e048691f8818373a96886b60a74a057a4d8420442abcd6e6b5b4f0b7ef1c
|
File details
Details for the file afl2_himpunan-0.1.1-py3-none-any.whl.
File metadata
- Download URL: afl2_himpunan-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c1f8ab17fe9c6b6035a44213c3477f42e0f44a88dff936859e077631e04d9a2
|
|
| MD5 |
e7bc50204c2fe2e5ed97c70b25065a4f
|
|
| BLAKE2b-256 |
4080c0f8a40eb7894341f75633cfbca6e32ca70024566810d470f92693c05b75
|