Logical operators
Logical operators are used check more than one condition at a time.
Logical operators allow you to combine or modify conditions.
Below are Types of logical operator
And—
It returns as Tue if both conditions are true else its returns false value.
Or—
It returns true if any of both condition is true, and returns false if both conditions are false.
Not—reverse the result, returns False if the results are true.
# Condition statement example
avengers_release_year = 2018
if(avengers_release_year > 2018) and (avengers_release_year < 2020):
print ("Avenger was released in
between 2018 and 2020")
print("")
print("carry on..")
Reference : Python Doc
No comments:
Post a Comment