Skip to content

mohdmot/PySwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

PySwitch

Sample Tool To Make Switch in Python

By : @zaky

Import -

This is Not a Pip Library , You Have To Use one of This Methods :

Method 1:

Import it Within Read The Code From Github Raw :

import requests
exec(requests.get('https://raw.githubusercontent.com/Zaky202/PySwitch/main/PySwitch.py').text)

Method 2:

Download PySwitch.py in Current Path of Your Script And Import it :

from PySwitch import *

Usage -

data='instagram'
switch(data,{
    case('twitter'):lambda:print('This is Twitter'),
    case('whatsapp'):lambda:print('This is Whatsapp'),
    case('instagram'):lambda:print('This is Instagram'),
    default():lambda:print('Somthing Else')
})

You Can Use Functions Too !!

def Func () :
  print('This is Twitter')

case('twitter') : Func

About

Switch in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages