7.if Else & Elif Conditionals in Python
7.if Else & Elif Conditionals in Python
Let's start today's topic of “If else and elif in python”, with
a definition:
For few viewers, the term “elif” is new as they are not
familiar with the word and it is also not like most of the
other words such as list or loops, etc. that have the same
meaning in the English language and in Python
programming. In fact, in English “elif” means honest. But if
you have ever done programming in any language, you
must be familiar with “else-if” statement, well “elif” is just
that.
Bonus part:
# var1 = 6
# var2 = 56
# var3 = int(input())
# if var3>var2:
# print("Greater")
# elif var3==var2:
# print("Equal")
# else:
# print("Lesser")
# list1 = [5, 7, 3]
# print(15 not in list1)
# if 15 not in list1:
# print("No its not in the list")
# Quiz
print("What is your age?")
age = int(input())
if age<18:
print("You cannot drive")
elif age==18:
print("We will think about you")
else: