Socket
Book a DemoInstallSign in
Socket

kecutil

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kecutil

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

pipPyPI
Version
0.0.6
Maintainers
1

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"

kecutil.clearConsole() Clears the console window

kecutil.clamp(value: int,length=2) Clamps a float to have the same number of decimals as the length Returns a new float

Keywords

python

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts