Skip to main content

Flipfloperator

This package implements the flip-flop operator in Python.

Install the package:

$ pip install flipfloperator

And then import the operator into your code:

from flipfloperator import ꓺ

Examples

Want to print out numbers between 1 to 20, but only after you reach 5 and stop when you reach 10?

>>> for i in range(1, 20 + 1):
...     if ꓺ(i == 5, i == 10):
...         print(i)
5
6
7
8
9
10

A handy text indenter:

>>> for line in '''
... zero indentation
... indent
... inside block
... dedent
... after the block
... indent
... another block
... dedent
... end of file
... '''.strip().split('\n'):
...     if ꓺ(line.startswith('indent'), line.startswith('dedent')):
...         print('  ' + line)
...     else:
...         print(line)
zero indentation
  indent
  inside block
  dedent
after the block
  indent
  another block
  dedent
end of file

And you too can find adorable cat nicknames in text:

>>> def bobo_nickname_finder(phrase):
...     name = []
...     phrase = phrase.replace('.', '').replace(',', '')
...     for word in phrase.split():
...         if ꓺ(word == 'Monsieur', word == 'Bobo'):
...             name.append(word)
...     return ' '.join(name)
>>> bobo_nickname_finder('''
... I have had a great day with this large boy, Monsieur Bobo.
... You may also know him as Monsieur 'Chonky' Bobo, or Monsieur
... 'Loves to Eat the Food' Bobo.
... ''')
"Monsieur Bobo Monsieur 'Chonky' Bobo Monsieur 'Loves to Eat the Food' Bobo"

Metadata

Release files for flipfloperator 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flipfloperator 0.1.2
File Size Uploaded
flipfloperator-0.1.2.tar.gz 2.1 kB Details

Release files / flipfloperator-0.1.2.tar.gz

Download URL flipfloperator-0.1.2.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c3c901758185c5f2cbc5d6838a1475ef07f556909ddeac19a2dfce6854eb031c
BLAKE2b-256 checksum
How to use checksums
3790e8a285e56aa53dd03cf30f4a9928208374a386539b69e2326c8e6b82961b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page