Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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!
Source by edube.org #
 
PREVIOUS NEXT
Tagged: #Comparison #operators #conditional #execution
ADD COMMENT
Topic
Name
2+5 =