ophiomormous

Collection of useful Python functions ported to JavaScript

Usage no npm install needed!

<script type="module">
  import ophiomormous from 'https://cdn.skypack.dev/ophiomormous';
</script>

README

Ophiomormous

A collection of useful Python functions ported to JavaScript

Functions

all

Returns true if all values are true

import { all } from 'ophiomormous'

all([1, true, 0, false])

any

Returns true if only one value is true

import { any } from 'ophiomormous'

any([1, true, 0, false])

divmod

Returns the quotient and remainder in a list

import { divmod } from 'ophiomormous'

divmod(36, 7)

enumerate

Returns a list of object with the character as the value and its index as the key

import { enumerate } from 'ophiomormous'

enumerate("Hello")

max

Returns the largest number

import { max } from 'ophiomormous'

max([9, 89, 8, 3, 0])

min

Returns the smallest number

import { min } from 'ophiomormous'

min([9, 89, 8, 3, 0])

range

Returns a list of numbers through a specified range and step

import { range } from 'ophiomormous'

range(7, 39, 8)

sum

Returns the sum of all values

import { sum } from 'ophiomormous'

sum([9, 7, 3, 22, 4])