how to do if else in python code example

Example 1: if statement in python

#Conditionals statements in python
#'=' conditionals statements
a = 123
b = 123

if(a==b):
  print('True')
  
#<, > conditionals statements

a = 2
b = 45

if(a<b):
  print('A is smaller than B')

Example 2: else if python

if (condion):
   result
    
elif (condition):
   results
    
else:
   result

Example 3: if else python

# IF ELSE ELIF
age=int(input("Enter your age:"))
if age<=18:
  print("sorry your are not eligible for vote")
elif age>=18:
  print("u are eligible for vote")
else:
  print("in some how the previou's condition fails else part will run")

Example 4: if else usage python

if expression:
   statement(s)
else:
   statement(s)