Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python Switch case statement using if-elif-else

# if-elif statement example 

fruit = 'Banana'

if fruit == 'Mango': 
    print("letter is Mango") 

elif fruit == "Grapes": 
    print("letter is Grapes") 

elif fruit == "Banana": 
    print("fruit is Banana") 

else: 
    print("fruit isn't Banana, Mango or Grapes")
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #Switch #case #statement
ADD COMMENT
Topic
Name
4+6 =