Skip to main content

Python implementation of Switch-Case

Project description

``SwitchCaseDev``
==============

``SwitchCaseDev`` is a command in python command which is similar to switch-case in java and python.
It is also a implementation of a simple Switch-Case in Python.

Basic Usage:
===============

``switch()``:
Basic Syntax:
.. code :: python
switch(case_list,default_value)

where,
case_list -> a dictionary item , it contains the dictionary of all the case in which switch will be applied
default_value -> it is the default value which will excute if any of the given case is not applied.

``case()``:
Basic Syntax:
.. code :: python
case(value)

where,
value -> the case the need to be applied.


Example :
.. code-block::python
import Switch_Case
exg=Switch_Case.switch(case_list={"a":2,"b":4},default_value=0)
print(exg.case("a"))

Output:
2

Note: All name I tried are unavailable so I switch the name to SwitchCaseDev.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SwitchCaseDev-0.1.tar.gz (1.4 kB view hashes)

Uploaded Source

Built Distribution

SwitchCaseDev-0.1-py3-none-any.whl (1.5 kB view hashes)

Uploaded Python 3

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