Skip to content
/ Switch Public

Python implementation of Switch Case statement.

License

Notifications You must be signed in to change notification settings

ayanbag/Switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

forthebadge made-with-python ForTheBadge built-with-love

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.

Installation:

pip install SwitchCaseDev

Module Interface:

1. switch():

Basic Syntax:

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.

2. case():

Basic Syntax:

case(value) where, value = the case the need to be applied.

Demo:

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

Output: 2

About

Python implementation of Switch Case statement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages