Join the conversation
print(x > z and y < x) # True
print(x != y and x != z) # True
Reply
we will use "and" and "or" operators
am i right?
Reply
![](https://codanics.com/wp-content/uploads/2024/02/20231117_174558.jpg)
update mtlb! tu smjha ni tu ni smjha
Reply
In a chained comparison, logical operators like 'and', 'or' are used to combine two or more comparison operators.
Reply
to use comparison operators in the same line we can use 'and' and 'or' if both condition are true the first one will show true else false and if one of them is true the letter will show true vice versa
Reply
"or" and "and" will give give resut based on the if one is true or both are true as seen in or logic gate and "and " logic gate .
But if you want to print result of both operaters separarte them with a comma
yes we can but syntax is wrong
Reply
different var bc it is case sensitive
Reply
PEMDAS (paranthesis exponent multiplications division addition subtraction )
Reply
codanics pakistan
Reply
will use if else
Reply