Skip to main content

Simple utility functions for KEC's Intro To Programming: Python Course

Project description

KEC ITP: Python Util Functions

Functions

kecutil.reduce(cb(cur, val), list, default) Reduce is used to reduce a list to one value. This is commonly useful when finding the longest string for example

from kecutil import reduce


strings = ["ab", "acb", "abcdef", "abd"]
longestString = reduce(lambda x, y: x if len(x) > len(y) else y, strings, "")

print(longestString) # "abcdef"

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

kecutil-0.0.5.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file kecutil-0.0.5.tar.gz.

File metadata

  • Download URL: kecutil-0.0.5.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for kecutil-0.0.5.tar.gz
Algorithm Hash digest
SHA256 041c9b2218d9374f32011d4ddf4066b67083f2120cb37582bb1ce35e9f09b49f
MD5 30424268c848a4cf43db1de33e23be80
BLAKE2b-256 bc6ec3ab298fd809b9a289a73b34d1004b625f77c9fc6c1d5c49d556e78ba907

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page