If Else & Elif Conditionals In Python

Code file as described in the video

# 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:
    print("You can drive")





Comments(5)

ROHIT@123 at 2019-06-23 09:30:09 says
thx biyaa
zadrain at 2019-06-23 09:30:09 says
age = int(input("enter your age")) if age <=4: print("enter logical age") elif age >=100: print("enter logical age") elif age > 18: print("you ca drive") elif age==18: print("we cant decide") else: print("you cant")
anubhavs921 at 2019-06-23 09:30:09 says
the answer of challenge given by you sir: print "what is your age" age = int(input()) if ((age<7) or (age>100)): print "you entered wrong age" elif age<18: print "you can not drive" elif age==18: print "We will think about you" else: print " you can drive"
omkarrege at 2019-06-23 09:30:09 says
not show description
sanayasingh at 2019-06-23 09:30:09 says
print("What is your age") age=int(input()) if age<18: print("You cannot drive") elif age==18: print("We will think about you") elif age>100: print("over age") else: print("You can drive")