Skip to main content

Sorry.

Project description

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"

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

flipfloperator-0.1.2.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file flipfloperator-0.1.2.tar.gz.

File metadata

  • Download URL: flipfloperator-0.1.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for flipfloperator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c3c901758185c5f2cbc5d6838a1475ef07f556909ddeac19a2dfce6854eb031c
MD5 b3d26c63ff9407e9758113003c1e5c4a
BLAKE2b-256 3790e8a285e56aa53dd03cf30f4a9928208374a386539b69e2326c8e6b82961b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page