Interview problem of Ant Fin
Project description
afivmax
安装
pip install afivmax
使用
from afivmax.afivmax import afiv_max
# args
assert 3 == afiv_max(1, 2, 3)
assert 3 == afiv_max(3, 3, 3)
# args with key
assert 3 ==afiv_max(1, 2, 3, key=lambda x: x ** 2)
class TmpClass:
def __init__(self, x):
self.val = x
assert 9 == afiv_max(*[TmpClass(x) for x in range(10)], key=lambda x: x.val).val
# iterables
assert 3 == afiv_max([1, 2, 3])
assert 3 == afiv_max([3, 2, 1])
assert 3 == afiv_max([3])
# iterables with keys
assert 3 == afiv_max([1, 2, 3], key=lambda x: x ** 2)
assert 9 == afiv_max([TmpClass(x) for x in range(10)], key=lambda x: x.val).val
# iterables with default
assert 10 == afiv_max([], default=10), "iterable with default only"
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
afivmax-0.3.0.tar.gz
(2.8 kB
view details)
File details
Details for the file afivmax-0.3.0.tar.gz
.
File metadata
- Download URL: afivmax-0.3.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a774d183d2be975800dd4ba739e48bb7cb88c545ea4b2e327fac5b9907efbc0 |
|
MD5 | 334b143f22b2e5198dbd1e1a8f5eaea8 |
|
BLAKE2b-256 | 91061f4b5089ce6da3b740a19b665fc426f4a3e3701521b1acf5794d3fc15afd |