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

Uploaded Source

File details

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

File metadata

  • Download URL: kecutil-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 242051827c5c258d9992a1c568592ce2ffc5f5b4b39505ef0c7c88a24f225a3f
MD5 8e1585d1f1690f76afb9c8dfdfd516a6
BLAKE2b-256 d2b883d417034c4f6a5abd15d43222e71e8bed5a1dd2e932557f66aa817bd177

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