Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Comparison operators and conditional execution

#Comparison operators and conditional execution

plant = input('')

if plant == "Spathiphyllum":
    print("Spathiphyllum is the best plant ever!")
elif plant == 'spathiphyllum':
    print("No, I want a big spathiphyllum.")
else:
    print("Spathiphyllum! Not "+plant+"!")
    
#Output:

spathiphyllum
No, I want a big spathiphyllum.
tulip
Spathiphyllum! Not tulip!
Spathiphyllum
Spathiphyllum is the best plant ever!
Comment

PREVIOUS NEXT
Code Example
Python :: How to print specific figure in python 
Python :: flask in colab ngrok error 
Python :: change y axis scale python 
Python :: python recognize lower and upper case user input 
Python :: three periods in python 
Python :: msg to pdf converter using python 
Python :: python two list into dictinaray list comprehension 
Python :: python get all the items list 
Python :: how to filter even or odd model id in django 
Python :: python get screen dpi 
Python :: Lists and for loops in python 
Python :: pyqt5.direct connection 
Python :: looping over folder to extract zip winrar python 
Python :: python array_combine 
Python :: datetime day deutsch python 
Python :: matplotlib include first number in plotter 
Python :: split credit card number python 
Python :: hidden semi markov model python from scratch 
Python :: Python program to remove newline characters from a file 
Python :: argc python 
Python :: custom dense layer 
Python :: Python Using Global and Local variables in the same code 
Python :: flask make_response render_template 
Python :: tornado cookies authorization 
Python :: input what is your name python 
Python :: reloading a django view function withouit resetting context data 
Python :: .text xpath lxml 
Python :: threading lock example 
Python :: how to update only some fields in django serielizer update method 
Python :: django admin difference between superuser and staff 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =