if, elif, and else with comparison operators.

PHOTO EMBED

Tue Apr 21 2020 11:15:59 GMT+0000 (Coordinated Universal Time)

Saved by @PinkGarden #python #python #condition #ifstatement #elifstatement #elsestatement

People = 30
Cars = 40
Trucks = 14
# line 1,2,3 assign the value to variables
If cars > people: Using if statement
  Print(“we should take the  cars.”)
Elif cars < people: if 1st is false execute elif
  print(“we should not take the car.”)
else : # if both are false then execute else:
    print(“we can’t decide.”)
                               
                                
content_copyCOPY

In this code three conditions like if, elif and else along with comparison operators.

https://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914