Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python switch

>>> def week(i):
        switcher={
                0:'Sunday',
                1:'Monday',
                2:'Tuesday',
                3:'Wednesday',
                4:'Thursday',
                5:'Friday',
                6:'Saturday'
             }
         return switcher.get(i,"Invalid day of week")<div class="open_grepper_editor" title="Edit & Save To Grepper"></div>
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #switch
ADD COMMENT
Topic
Name
4+9 =