Collection of handy random generators.
Project description
xu
Collection of handy random generators.
classes | objects | functions |
---|---|---|
integer | boolean | pick |
number | char | |
string | random |
Examples
from xu import string
print(string(10).lower)
print(string(10).upper)
print(string(10).digit)
print(string(10).alpha)
print(string(10).latin)
print(string(10).list(2))
eoqsalszaj
FCVYJZIDMY
6712277415
oTrbOHkUbd
NcrW4STecT
['euZY9gFrzx', '0AEepSNvAO']
from xu import boolean
for it in boolean.matrix(2, 4):
print(it)
[False, True]
[True, False]
[True, True]
[False, False]
from xu import pick
data = [1, 2, 3, 4]
print(pick(data))
data = '1234'
print(pick(data, 2))
3
['2', '3']
from xu import integer
print(integer(9) * 5)
print()
for row in integer(9) ** 5:
print(row)
print()
for row in integer(9) ** (5, 3):
print(row)
[4, 9, 1, 3, 5]
[4, 2, 0, 8, 8]
[0, 3, 9, 4, 2]
[5, 1, 1, 8, 2]
[1, 5, 3, 5, 6]
[6, 1, 1, 0, 2]
[1, 1, 6, 1, 8]
[4, 0, 2, 3, 9]
[1, 5, 7, 2, 4]
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
xu-0.2.0.tar.gz
(4.2 kB
view details)
Built Distribution
xu-0.2.0-py3-none-any.whl
(4.0 kB
view details)
File details
Details for the file xu-0.2.0.tar.gz
.
File metadata
- Download URL: xu-0.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f09b05afead68702217d967af7366c415a6de6c575580b1478a8a5bdd541905 |
|
MD5 | 9f1d69beca97af1ce17e46df398f5a07 |
|
BLAKE2b-256 | 67e536b6b44c2bde155db8d430c171699b7dfe12e15ada3e7971ef69c5411a9b |
File details
Details for the file xu-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: xu-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e37901230ff6b48deca7e3d0d67898dba69ab361765077d3a46a32f0ef92eba |
|
MD5 | b8383921b6ea255e2f1746159ab93dcb |
|
BLAKE2b-256 | 2998c78526e06cf0afe1ba2c36e1999223a89a8c170f333bcd8db3f2514e4a21 |