A code in python on eligibility to apply for a driving license using if else

print("enter your age")
age=int(input())
if 18<age<100:
print("you can drive")

elif age==18:
print("you have to appear for a driving test")
elif age>100:
print("error")
elif age<7:
print("invalid age")
elif 7<age<18:print("you cannot drive")
Above code tells us whether a person can issue a driving license or not by taking his or her 
age as a decisive factor. This code also bans children under 7 or above 100 to apply for the
driving license.
 TIP- if you use elif statement more, there is less chances to get an error because here python 
checks objectively for the result and does not go to next line if it gets the suitable result on
the current elif(else if) statement.
  

Comments