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)

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.3.tar.gz (1.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: kecutil-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 36ddc88f1df5f145f4280fc4e16915c2bbafb5a71377cb63a285a9ba4e00966f
MD5 181cb19576cd9366328a3492425ec191
BLAKE2b-256 995e1a9436119a1ee69c41031dbc65c7edee44a63985cdabd379e414cd289a19

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