Search
 
SCRIPT & CODE EXAMPLE
 

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")
Comment

PREVIOUS NEXT
Code Example
Python :: Flatten List in Python Using Shallow Flattening 
Python :: Simple Python Permutation Passing argument as the second parameter 
Python :: Simple Example to Plot Python Treemap with lables 
Python :: Accessing element using negative indexing 
Python :: Code to find maximum number using if else 
Python :: how to decide that the input must be a integer less than 5 in python 
Python :: pandas check if string has only spaces 
Python :: python print numbers with commas 
Python :: for loop for many integers in list 
Python :: your momma in python 
Python :: Algorithms and Data Structures in Python (INTERVIEW Q&A) 
Python :: get channel name by channel id discord py 
Python :: install python glob module in MacOS using pip 
Python :: Loading data from Oracle Database to pandas DataFrames 
Python :: Python NumPy squeeze function Example with axis=1 
Python :: Python NumPy Shape function example Printing the shape of the multidimensional array 
Python :: how to make dinamic table in jinja python 
Python :: Python NumPy asfortranarray Function List to an array 
Python :: Python NumPy split Function Example when index attribute given wrong 
Python :: Python NumPy vsplit Function Syntax 
Python :: python __truediv__ 
Python :: NumPy rot90 Example Rotating Three times 
Python :: colorbar over two axes 
Python :: make a dict from td scrape 
Python :: fibo_itrativ 
Python :: Demonstration of Python range() 
Python :: how to remove a strech in pyqt5 
Python :: genisim 4.0 words 
Python :: block-all-mixed-content csp bypass python 
Python :: how to click button and download a file using robot frame work or selenium, it not contains link 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =