Use of only "if" statement with comparison operators


Tue Apr 21 2020 10:34:57 GMT+0000 (UTC)

Saved by @AwesomeMe #python #python #ifstatement #comparisonoperators

People = 20
Cats = 30
Dogs = 15
# line 1,2 and 3 assigning values to variables 
If people < cats: #1st condition
print(“too many cats”)
If people > cats: #2nd condition
print(“not many cats.”) # 3rd condition
If people > dogs:
print(“ the world is dry.”)

The above code is a simple example of if statement and comparison operators. There is no other statement like elif, else etc.